-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add metrics: bridge_matrix_api_calls and …_failed #2
Conversation
mautrix/client/api/events.py
Outdated
API_CALLS = Counter("bridge_matrix_api_calls", | ||
"The number of Matrix client API calls made", ("update_type",)) | ||
API_CALLS_FAILED = Counter("bridge_matrix_api_calls_failed", | ||
"The number of Matrix client API calls which failed", ("update_type",)) |
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.
Do these need to be imported in a web endpoint function or does a creation of Counter()
already add the metric to a Prometheus endpoint?
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.
It's magic, you don't need to do anything :)
Possible improvements (possibly in another PR, given the urgency):
|
I feel like there has gotta be a way to do this with attributes in python |
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.
Code looks great, if it works we can shippit
Ah, @jaller94 can you also open this upstream to mautrix as well? |
bridge_matrix_api_calls
andbridge_matrix_api_calls_failed