Instrumentation prepares software to emit telemetry and collects that telemetry for analysis. It makes systems observable, helping detect anomalies and threats; telemetry becomes useful when it is captured, stored, and processed into insights. section 11.3
Instrumentation can be added in two practical ways:
- Add code that emits specific logs, such as database-query logs, when the required signal is not produced by default. section 11.3
- Capture request and response logs already produced by web frameworks and store them for analysis. section 11.3
- Use OTel autoinstrumentation to produce useful signals without code changes by installing dependencies and wiring up the application. section 11.3
FastAPI with OTel
A Python FastAPI application can use OTel’s command-line instrumentation to export traces, metrics, and logs to the console while starting Uvicorn. A generated span can identify a GET /books request and include timing, route, method, host, and status attributes.












