-
Notifications
You must be signed in to change notification settings - Fork 369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Background job custom error handlers #1212
Background job custom error handlers #1212
Conversation
@norbertnytko Thanks for the contribution. I've given this a quick pass, this looks like great work and very thorough. Would you mind describing your use case here a bit more? My understanding is, there are some background jobs that throw errors which you may not want marked as an I think what you're proposing is reasonable, and recently we've seen a few use cases where users would like to pass in a custom |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- One small nit is that we'll need to update the config instructions in
GettingStarted.md
to reflect the new options for each integration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work here. lgtm, approving. I'd like to have one of the other maintainers take a look here as well so going to wait to merge this in until next week when they return from PTO, if that's ok.
Some good next steps here for future work:
- validation around the Proc that gets passed in.
- we'd probably want to do this within the
tracer.trace
rescue block and log a debug or warn msg if the arg doesn't respond tocall
, but don't think this is blocking at the moment since we don't do vallidation around thetracer.trace
on_error
arg currently.
- we'd probably want to do this within the
- extending
error_handler
to other integrations beside just workers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you again, @norbertnytko! Looks to me.
Goal
Allow passing custom error handler for background job gems. Useful to retry jobs for known transient errors without reporting errors to Datadog.
Example usage: