-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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
feat: add statsd metrics for notifications #20158
Conversation
Codecov Report
@@ Coverage Diff @@
## master #20158 +/- ##
==========================================
- Coverage 66.45% 66.27% -0.19%
==========================================
Files 1721 1722 +1
Lines 64513 64656 +143
Branches 6806 6821 +15
==========================================
- Hits 42875 42849 -26
- Misses 19906 20074 +168
- Partials 1732 1733 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
metric_prefix_ = metric_prefix or f.__name__ | ||
try: | ||
result = f(*args, **kwargs) | ||
current_app.config["STATS_LOGGER"].gauge(f"{metric_prefix_}.ok", 1) |
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.
Does this allow for the end user to set a custom prefix?
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.
yes, when creating a custom statsd logger class
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.
Can we add some tests?
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.
Looks great!
* feat: add statsd metrics for notifications * fix import * fix lint * add decorator arg for custom prefix * add tests
SUMMARY
Add a statsd gauge metric for Slack and email notifications.
We want to add more visibility for Alerts & Reports notifications: how many errors, how many notifications were sent
ADDITIONAL INFORMATION