Oban.Pro.Batch individual job telemetry exception events not executed?

Hello!

We’re using a custom telemetry handler for Oban [:oban, :job, :exception], slightly tweaked from the default one. We’re sending errors to sentry when job.attempt >= job.max_attempts, but we noticed many jobs in the :discarded state for which we don’t see Sentry issues. The telemetry handler doesn’t seem to be getting detached, we’re not seeing in logs this happening. We haven’t confirmed yet but now we have an idea that maybe it is happening for individual Batch worker jobs only…

So here’s our question: for batch worker jobs, is the exception telemetry event getting reliably executed for each discarded job separately?

:thinking: We currently also have the built-in Appsignal instrumentation enabled sending errors for discarded jobs, and now I checked that I do see all of the discarded jobs getting reported there. I don’t see errors being dropped in Sentry stats, so I’m a bit puzzled as to why they are getting reported to Appsignal but not to Sentry.

Telemetry is reported the same way for batch jobs as any other. It doesn’t seem like you’re missing any events there.

Do you have any jobs that are returning :discard or {:discard, reason} directly? That has been deprecated for a while now, but it’s still valid and it will emit an [:oban, :job, :stop] event rather than :exception.

Do you have any jobs that are returning :discard or {:discard, reason} directly? That has been deprecated for a while now, but it’s still valid and it will emit an [:oban, :job, :stop] event rather than :exception.

No, but thanks for the idea

I think I figured it out, after adding some extra logging I found that the telemetry handler does run, but Sentry is excluding this error from being sent, I believe because of the default dedup_events: true configuration (sentry configuration docs)

1 Like