r/FastAPI • u/itssimon86 • Feb 20 '24
Other How do you monitor your FastAPI apps?
As in, keep track of requests, error rates, response times etc.? Curious what tools people use!
8
u/Drevicar Feb 20 '24
ELK for logs, Prometheus for metrics, Jaeger for traces. Otel collector on FastAPI, our database, and a couple manual spans in the hot path. All logs are structured JSON that include correlation ID so we can trace between services within a single request response flow.
1
u/itssimon86 Feb 20 '24
Sounds like quite a complex setup! But probably provides very comprehensive insights.
1
u/Drevicar Feb 20 '24
It started with none of this, and grew into this over time as requirements and SLAs piled on. It also helps we are running this in k8s, so some of this is easier than normal or ships with our distribution.
4
2
u/andrewthetechie Feb 20 '24 edited Oct 01 '26
The original post content no longer exists here. The author used Redact to remove it, exercising their right to control their data & privacy.
Many nine wipe dime reach cooperative one
2
u/high_on_meh Feb 20 '24
I have played with https://pypi.org/project/opentelemetry-instrumentation-fastapi/
It's kind of weird monitoring your API with....more APIs! But it's fairly trivial to setup Prometheus to scrape and generate graphs.
1
u/Apitally Jun 24 '24
Apitally is great for monitoring FastAPI apps! And super easy to set up.
We provide insights into API traffic, errors, and performance, for the whole API, each endpoint and individual API consumers. Apitally also monitors API uptime, alerting users when their API is down.
1
u/coldflame563 Feb 20 '24
Depending on how you’ve deployed is a key thing here. You could instrument using Prometheus and metric scraping for k8s. Or if running in lambda use the integrated tooling. There’s also nginx based monitoring, separate auth monitors etc. lots of options
1
u/Wowawiewa Feb 20 '24
Sentry for errors/exceptions and GCP logs with fluent-bit for everything else
0
Feb 20 '24
[deleted]
2
u/itssimon86 Feb 20 '24
We use Datadog at work as well, but mostly for infrastructure monitoring and APM. Pricey indeed. And sometimes hard to navigate..
0
Feb 20 '24
[deleted]
3
u/Apitally Feb 20 '24 edited Feb 20 '24
Thanks for the mention and glad you’re enjoying using Apitally!
We certainly aim to make API monitoring super easy. All it takes is to add a couple of lines of code to a FastAPI project. And then you get all your API metrics and insights on an intuitive dashboard!
2
2
9
u/Trinkes Feb 20 '24
I usually use Sentry for error tracking