Skip to main content
Manual instrumentation requires adding metric calls inside your application code and updating them as the code evolves. That gives precise control, but it demands developer time, coordination across teams, and ongoing maintenance. When you need the standard “golden-signal” metrics quickly across many services, manually instrumenting every service may be impractical. Auto-instrumentation provides a lower-effort, faster path to basic observability by hooking into frameworks and runtimes to emit common metrics without changing business logic. One widely adopted standard for auto-instrumentation is OpenTelemetry (OTel). OpenTelemetry is a CNCF project that provides libraries for major languages and frameworks — Python, Java, Node.js, .NET, Go and frameworks such as FastAPI, Flask, Django, Spring Boot, and Express. Here’s the general workflow.
An OpenTelemetry infographic showing the OpenTelemetry logo in the center and lists supported languages (Python, Java, Node.js, .NET, Go) on the left and frameworks (FastAPI, Flask, Django, Spring Boot, Express) on the right.
How auto-instrumentation typically works
  1. Choose and initialize an exporter.
    OpenTelemetry uses an internal metric model; an exporter converts that model into your backend’s format. A common choice for Prometheus users is the Prometheus exporter, which exposes an HTTP endpoint that Prometheus can scrape.
  2. Wire the exporter into the OTel metric pipeline.
    This configures the MeterProvider (or equivalent) so captured metrics flow to your exporter and metric backend.
  3. Enable framework instrumentation.
    Install and activate the instrumentation package for your framework (for example, FastAPIInstrumentor). The instrumenter intercepts framework-level operations (HTTP requests, DB calls, etc.) and emits standard metrics automatically.
Minimal Python + FastAPI example (Prometheus exporter)
What the instrumenter does for each request
  • Records request start time on entry.
  • On completion, records response status and computes duration.
  • Emits counters and histograms with labels such as path, method, and status_code so you can slice-and-dice traffic, errors, and latency.
Why this helps
  • Your application code remains unchanged: instrumentation runs at the framework level.
  • You quickly collect the classic observability signals across many services without touching business logic.
  • Once the OTel stack is in place, adding traces or correlated logs is straightforward.
Which telemetry does auto-instrumentation provide? Auto-instrumentation maps well to the four golden signals:
A presentation slide titled "Auto-Instrumentation – What Do You Get?" showing the four golden signals of observability (Traffic, Errors, Latency, Saturation) with associated metrics. Examples listed include HTTP request counts, 4xx/5xx errors and response codes, P50/P95/P99 percentiles and request duration histograms, plus disk I/O, memory and CPU.
Best practices and trade-offs
  • Use auto-instrumentation for framework and infrastructure signals (HTTP, DB clients, runtimes).
  • Use manual instrumentation for domain-specific metrics (orders placed, conversion rate, payment status).
  • Combine both approaches: auto-instrumentation provides the baseline golden signals while manual instrumentation captures business semantics.
OpenTelemetry covers metrics, traces, and logs. This guide focuses on metrics, but the same OTel libraries make it simple to add distributed tracing and correlated logging later — adopt OTel now to ease future expansions into tracing and log correlation.
A slide titled "A Note on OpenTelemetry" showing three stylized columns labeled "Metrics" (purple), "Logs" (orange), and "Traces" (green). The columns represent the core observability signals.
Important limitation Auto-instrumentation cannot infer your business logic or domain concepts. It will not count orders placed by product category or track feature-specific usage unless you add explicit instrumentation inside your application.
Auto-instrumentation does not replace domain-specific metrics. For metrics tied to business behavior (for example, orders_created or payment_attempts), add manual instrumentation in your code alongside auto-instrumentation.
When to choose auto-instrumentation Next steps / resources A hands-on lab demonstrates using Python, FastAPI, and OpenTelemetry together to auto-instrument an application and add manual metrics where needed.

Watch Video

Practice Lab