Lab — Add full observability to a FastAPI service#
Objective#
Instrument a FastAPI application to export metrics and traces, and build a Grafana dashboard to monitor it.
Requirements#
- Instrument an existing FastAPI app using the OpenTelemetry Python SDK.
- Export metrics (request count, latency) to Prometheus.
- Export traces to Jaeger or a similar tracing backend.
- Run FastAPI, Prometheus, and Grafana locally using Docker Compose.
- Create a Grafana dashboard visualizing API request rates and P99 latency.
Deliverables#
- The
docker-compose.ymlfile. - A screenshot of your Grafana dashboard under load (use a tool like
aborlocustto generate traffic).