Alpha

Python requests, no code change.

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.

0 code
for FastAPI, Flask, and Django
1 package
an OpenTelemetry distro
Soon
on PyPI; from GitHub today
terminal
# 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
GET /orders · 92 ms
GET /orders92 ms
SELECT id, customer_id FROM orders WHERE status = %s2.6 ms
SELECT sku, qty FROM order_items WHERE order_id = %s1.3 ms
GET pricing/prices47 ms
info loaded 12 orders

What gets captured.

Everything below lands in the same trace as the request that caused it.

Frameworks

  • FastAPI
  • Flask
  • Django
  • One server span per FastAPI request
  • Request and response bodies (opt-in)

Databases

  • SQLAlchemy
  • psycopg
  • sqlite3
  • Parameters on every DB-API driver
  • connection.execute() too

Calls out

  • requests
  • httpx
  • The trace carried to the next service

Logs

  • Every logging line, with its trace
  • basicConfig and dictConfig still work

Insights

  • N+1 queries
  • N+1 HTTP calls
  • Duplicate queries
  • Slow queries
  • Database waits

Packages

  • Every installed PyPI package
  • Checked against OSV on the hub and cloud
  • Off with WIZELENS_PACKAGES=false

Auto-instrumentation, with WizeLens defaults.

It finds the package on its own.

wizelens is an OpenTelemetry distro and configurator, so opentelemetry-instrument loads it. Do not also install opentelemetry-distro.

Logs are on.

Plain OpenTelemetry leaves logs off. WizeLens sends each logging line with the trace it was written in.

One line for bodies.

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)

No opentelemetry-instrument? One call.

Call configure before your app imports its libraries, then instrument them yourself.

wizelens.configure(service_name="orders-api")

Mixing stacks? One trace across all of them.

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.