This repository is built by highlight.io, an open source observability platform that has both a cloud service and a self-hosted offering. OpenTelemetry is a spec supported by many observability providers, but if you want an opinionated, easy to use, and fully featured observability platform, you can head over to highlight.io.
This repository is a simple FastAPI application that demonstrates how to use OpenTelemetry to instrument a FastAPI application. For the full guide, see this blog post.
This repository covers:
- Setting up basic logs, traces, and metrics and how to forward this over to an OTEL backend (see
o11y.py
) - Catching every incoming request using the standard
traceparent
header, and creating a span for each request - Instrumenting outgoing requests using the
requests
library
- Python 3.8 or higher
- Poetry
-
Clone the repository
-
Configure your
HIGHLIGHT_PROJECT_ID
(or your vendor's specific config) ino11y.py
-
Install dependencies:
poetry install --no-root
-
Run the app:
poetry run uvicorn main:app --reload