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
minimal fastapi prom metrics #1426
Conversation
❌ pre-commit failed. |
Here is example of all the default metrics this gives:
|
❌ pre-commit failed. |
pre-commit acting funny here - i think it deleted the file |
if we merge this i can update this PR to scrape those metrics so also would be available in netdata. will also try make another PR to add Prometheus and Grafana. |
❌ pre-commit failed. |
❌ pre-commit failed. |
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.
ok, looks great!
Summary:
This PR uses https://github.com/trallnag/prometheus-fastapi-instrumentator to add a
/metrics
endpoint to the fastapi app that can then be scraped by Prometheus, netdata or any other monitoring tools.Here is example of default metrics endpoint:
You can see it has typical enough metrics for each endpoint etc.
If we wanted to of course we could also add custom metrics easily enough: https://github.com/trallnag/prometheus-fastapi-instrumentator#creating-new-metrics