finds.dev← search

// the find

blueswen/fastapi-observability

★ 1,115 · Python · MIT · updated Apr 2026

Observe FastAPI app with three pillars of observability: Traces (Tempo), Metrics (Prometheus), Logs (Loki) on Grafana through OpenTelemetry.

A working demo that wires together FastAPI, Prometheus, Tempo, and Loki so you get all three observability pillars talking to each other in Grafana — metrics linking to traces, traces linking to logs, and back again. It's aimed at developers who want to see how the full stack fits together before setting it up themselves. Not a library you install; a reference implementation you study and adapt.

The cross-signal correlation is the whole point and it actually works — exemplars on histograms carry trace IDs into Prometheus so you can jump from a slow p99 spike directly to the offending trace in Tempo. The multiline log pipeline in the Loki Docker driver config is a real gotcha that most tutorials skip, and this one handles it. The README explains *why* you need OpenMetrics content type for exemplars, not just what to copy-paste. Three-service chain endpoint gives you a realistic distributed trace to look at rather than a toy single-service example.

It requires the Loki Docker driver plugin, which is a host-level installation step that breaks the usual 'just docker-compose up' expectation and causes confusing errors if you miss it. The Prometheus scrape config is static — three hardcoded app targets — so you'd need to rethink this entirely for anything beyond the demo. No alerting setup at all: you get dashboards but nothing that pages you when the p99 goes sideways. The code-based instrumentation approach means any new route you add needs manual wiring; there's no mention of how to handle background tasks or Celery workers that share the same service.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →