Skip to content
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 about Matrix API events #67

Closed
wants to merge 15 commits into from

Conversation

jaller94
Copy link
Contributor

This adds the following Prometheus metrics:

  • bridge_matrix_api_calls Counter: Number of API calls made
  • bridge_matrix_api_calls_failed Counter: Number of API calls which failed
  • matrix_request_seconds Histogram: Duration in seconds of each API call

The names and types have been chosen to match those of https://github.com/matrix-org/matrix-appservice-bridge.

Incomplete list of things which could be improved

  • Cover other parts of the API, not just events.py.
  • Write a wrapper function as the current code includes a lot of repetition.

Copy link
Member

@tulir tulir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Write a wrapper function as the current code includes a lot of repetition.

I think this is required. Could just build the wrapper into request itself (so that the current request is renamed to _request or something)

@jaller94
Copy link
Contributor Author

Because of the difference in implementation, I opened the competing PR #68 to address the feedback for this PR.

@jaller94
Copy link
Contributor Author

Closing in favour of #68

@jaller94 jaller94 closed this Nov 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants