Skip to main content

Application Instrumentation

Add observability to your applications with OpenTelemetry. This guide helps you choose the right approach and find documentation for your stack.

Choose Your Approach

ApproachBest ForSetup TimeFlexibility
Auto-InstrumentationQuick start, standard frameworksMinutesPre-defined spans
Custom InstrumentationBusiness metrics, fine controlHoursFull control
AI ObservabilityLLM calls, agents, token/cost trackingHoursGenAI semantic conventions
All threeProduction AI applicationsHoursBest of all

Quick Reference Matrix

Find your language and see what's available:

LanguageAuto-InstrumentationCustom Instrumentation
PythonDjango, Flask, FastAPI, CeleryPython SDK
Node.jsExpress, Fastify, NestJS, Next.js, Node.jsNode SDK
JavaSpring Boot, QuarkusJava SDK
GoGo, AxumGo SDK
RubyRails, Rails LegacyRuby SDK
PHPLaravelPHP SDK
.NETASP.NET CoreC# SDK
ElixirPhoenix-
Rust-Rust SDK
BrowserReactBrowser SDK

Decision Guide

Instrumentation decision flowchartInstrumentation decision flowchart

What Gets Instrumented

Auto-Instrumentation Captures

  • HTTP requests - Incoming and outgoing, with method, status, URL
  • Database queries - SQL statements, connection info, duration
  • External API calls - gRPC, REST, message queues
  • Framework internals - Middleware, routing, templating

Custom Instrumentation Adds

  • Business transactions - Order processing, payment flows
  • User context - User ID, tenant ID, session info
  • Custom metrics - Conversion rates, queue depths, cache hit ratios
  • Domain-specific spans - Algorithm execution, batch processing

AI Observability Adds

  • LLM call tracing - Model, provider, token counts, cost per call
  • Agent pipeline spans - Which agent ran, how long, what failed
  • Cost attribution - Cost by model, agent, or business operation
  • Quality evaluation - LLM output scores tracked over time
  • PII-safe telemetry - Prompt/completion scrubbing before export

Next Steps

  1. New to OpenTelemetry? Start with auto-instrumentation
  2. Need business metrics? Add custom instrumentation
  3. Need to collect data? Set up the OpenTelemetry Collector
Was this page helpful?