diff --git a/go.mod b/go.mod index cea454d6..1cfb2428 100644 --- a/go.mod +++ b/go.mod @@ -40,7 +40,7 @@ require ( github.com/riverqueue/river v0.35.1 github.com/riverqueue/river/riverdriver/riverpgxv5 v0.35.1 github.com/riverqueue/river/rivertype v0.35.1 - github.com/riverqueue/rivercontrib/otelriver v0.7.0 + github.com/riverqueue/rivercontrib/otelriver v0.8.0 github.com/rodaine/table v1.3.1 github.com/sourcegraph/jsonrpc2 v0.2.1 github.com/spf13/cobra v1.10.2 diff --git a/go.sum b/go.sum index ec5fa664..689ff902 100644 --- a/go.sum +++ b/go.sum @@ -382,6 +382,8 @@ github.com/riverqueue/river/rivertype v0.35.1 h1:7SfjZ3Hkr7gRjItMHAUzJBAHIqx41yS github.com/riverqueue/river/rivertype v0.35.1/go.mod h1:D1Ad+EaZiaXbQbJcJcfeicXJMBKno0n6UcfKI5Q7DIQ= github.com/riverqueue/rivercontrib/otelriver v0.7.0 h1:zLjPf674dcGrz7OPG2JF5xea0fyitFax6Cc6q370Xzo= github.com/riverqueue/rivercontrib/otelriver v0.7.0/go.mod h1:MuyMZmYBz3JXC8ZLP0dH9IqXK95qRY6gCQSoJGh9h7E= +github.com/riverqueue/rivercontrib/otelriver v0.8.0 h1:zBFuoMhcGq0P1rrNl+kbxW6A2EI3/eRROAkY6bnNCZE= +github.com/riverqueue/rivercontrib/otelriver v0.8.0/go.mod h1:qwnMagI9IsFGEaKlp5oMecLGxE4byhOk8kqis7oeomo= github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rodaine/table v1.3.1 h1:jBVgg1bEu5EzEdYSrwUUlQpayDtkvtTmgFS0FPAxOq8= diff --git a/vendor/github.com/riverqueue/rivercontrib/otelriver/middleware.go b/vendor/github.com/riverqueue/rivercontrib/otelriver/middleware.go index be7e10b3..e47a3fd8 100644 --- a/vendor/github.com/riverqueue/rivercontrib/otelriver/middleware.go +++ b/vendor/github.com/riverqueue/rivercontrib/otelriver/middleware.go @@ -211,10 +211,18 @@ func (m *Middleware) Work(ctx context.Context, job *rivertype.JobRow, doInner fu duration := m.durationInPreferredUnit(time.Since(begin)) if err != nil { + var batchResult interface { // To be superseded if riverbatch.MultiError is moved to rivertype. + ErrorsByID() map[int64]error + } + if errors.As(err, &batchResult) { + err = batchResult.ErrorsByID()[job.ID] + } + var ( cancelErr *river.JobCancelError snoozeErr *river.JobSnoozeError ) + switch { case errors.As(err, &cancelErr): attrs = append(attrs, attribute.Bool("cancel", true)) diff --git a/vendor/modules.txt b/vendor/modules.txt index 63c4cc03..324c4253 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -774,8 +774,8 @@ github.com/riverqueue/river/rivershared/util/valutil # github.com/riverqueue/river/rivertype v0.35.1 ## explicit; go 1.25.0 github.com/riverqueue/river/rivertype -# github.com/riverqueue/rivercontrib/otelriver v0.7.0 -## explicit; go 1.24.0 +# github.com/riverqueue/rivercontrib/otelriver v0.8.0 +## explicit; go 1.25.0 github.com/riverqueue/rivercontrib/otelriver # github.com/rodaine/table v1.3.1 ## explicit; go 1.21