-
Notifications
You must be signed in to change notification settings - Fork 0
feat(reporter/sentry): filtering funcs to set custom error level on sentry #18
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
reporter/sentry/options.go
Outdated
|
|
||
| var ( | ||
| defaultErrorLevelFuncs = []ErrorLevelFunc{ | ||
| ErrorIsFunc(context.DeadlineExceeded, sentry.LevelWarning), |
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.
Won't this hide some big errors ? Like deadlock or things like that ?
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.
Thankfully this doesn't hide them, simply marks them as severity "Warning", which will allow us to have 2 different boards (one for errors, one for warnings), which ought to filter a lot of the noise.
We'll still notice if we have 3000 warnings rise up all of a sudden 👀
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.
Yeah ok nice :)
lordteka
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.
Nice improvment, also nice effort on the doc/comment
reporter/sentry/options.go
Outdated
| } | ||
| } | ||
|
|
||
| // ErrorCauseTextContainsFunc an ErrorLevelFunc of the passed level that checks |
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.
missing a word here
karitham
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.
🚀
reporter/sentry/options.go
Outdated
| } | ||
|
|
||
| // AppendErrorLevelFuncs adds the passed funcs to the ErrorLevelFuncs of the Reporter | ||
| func AppendErrorLevelFuncs(funcs []ErrorLevelFunc) Option { |
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.
| func AppendErrorLevelFuncs(funcs []ErrorLevelFunc) Option { | |
| func AppendErrorLevelFuncs(funcs ...ErrorLevelFunc) Option { |
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.
clever man
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.
UX improvements through the roof.
You can do the replace one as well but I think that one is less important, and it makes sense there to pass nil to remove any filtering, wheras ReplaceErrorLevelFuncs() isn't really self-descriptive
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.
Yeap, and I feel like it expects a "whole" array for replacement rather than a variadic
It most likely also won't be used much 😄
AlexisMontagne
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.
Overall it looks good!
| } | ||
|
|
||
| ts := tags.GetTags(err) | ||
| errorTags := tags.GetTags(err) |
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.
nitpick: the repository is already named errors is the error part of errorTags really needed? could it simply be tags?
Same feedback for:
computeErrorLevelerrorLevelMappers
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.
The problem here is that tags is a symbol already (the import name for that package), and I really dislike it being called ts or t. Any other suggestion that does not make it illegible? 😓
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.
that makes sends for errorTags, could you adjust the two others?
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.
yeah, can do when I next get to work on this one 👍
What does this PR do?
Fixes #
What are the observable changes?
Good PR checklist
Additional Notes