-
-
Notifications
You must be signed in to change notification settings - Fork 207
feat(oban): add option to include job tags into reported exception tags #950
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
base: master
Are you sure you want to change the base?
Conversation
5353efd to
eb115b9
Compare
|
Hi @solnic, sorry for the ping, but do you think this proposition has any chance of happening? |
whatyouhide
left a comment
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.
I think it's fine to add this as a separate boolean to the config. Changing :capture_errors to be a keyword list would make the main "turn on" option awkward:
capture_errors: [
enabled: true, # ? Whatever I think here sucks
tags: true
]However, I think we should rename :oban_tags to :add_oban_tags_as_tags or something more explicit.
Another question: if we report this as a single Sentry tag like oban_tags → tag1,tag2, aren't we missing out on being able to manipulate tag1 and tag2 individually in Sentry itself? Should we instead report those as
%{
"oban_tags.tag1" => true,
"oban_tags.tag2" => true
}?
|
Thank you @whatyouhide for looking into it, I renamed the option to Regarding how we report those tags to Sentry I really like your suggestion and it fits my current use case perfectly. However, there are a couple of caveats worth considering:
Alternative approach: We could leave this decision to developers by allowing them to provide a transformation function. For example: oban_tags_to_sentry_tags: fn job ->
["oban_tags": Enum.join(job.tags, ",")]
endor your version oban_tags_to_sentry_tags: fn job ->
Map.new(job.tags, fn tag -> {"oban_tags.#{tag}", true} end)
endI think this is up to you to decide which way we should go |
|
I think oban_tags_to_sentry_tags: fn _job -> %{} endMakes sense? |
Replace `add_oban_tags_as_tags` boolean with `oban_tags_to_sentry_tags` function option for flexible tag transformation from Oban job tags to Sentry tags.
|
Definitely makes sense. I’ve committed the changes, and I think we’re getting closer to something that could be released. Let me know what you think |
Description
Added an
oban_tagsoption to theobanconfiguration to include a job's tags in the tags of the Sentry issue created. The goal is to have ownership rules based on the tags of an Oban job.This is likely not ready to merge as is at least more thought needs to be put into the configuration option. Should we consider changing
capture_errorsinto a keyword list, similar tocron? That would be a breaking change.I'm opening this PR mainly to discuss whether you’d consider such a feature.
Thank you!