Frameworks
- FastAPI
- Flask
- Django
- One server span per FastAPI request
- Request and response bodies (opt-in)
opentelemetry-instrument traces FastAPI, Flask, Django, SQLAlchemy, psycopg, requests, and httpx. The wizelens package plugs into it and adds SQL parameters, logs, and sampling that keeps errors. It is coming to PyPI; install it from GitHub today.
# until it is on PyPI, from GitHub pip install "wizelens @ git+https://github.com/brandonkorous/wizelens#subdirectory=python" opentelemetry-bootstrap -a install # instrumentations for your libraries export OTEL_SERVICE_NAME=orders-api opentelemetry-instrument uvicorn app:app
Everything below lands in the same trace as the request that caused it.
wizelens is an OpenTelemetry distro and configurator, so opentelemetry-instrument loads it. Do not also install opentelemetry-distro.
Plain OpenTelemetry leaves logs off. WizeLens sends each logging line with the trace it was written in.
Add the middleware for your framework and set WIZELENS_CAPTURE_BODY=true. Text and JSON bodies are kept, up to 16 KB each.
app.add_middleware(WizeLensMiddleware)Call configure before your app imports its libraries, then instrument them yourself.
wizelens.configure(service_name="orders-api")A Vue front end, a .NET gateway, a Node service, and a Python worker join the same trace, and the same insights run on all of it.