Search

Search IconIcon to open search

OTel SDK and Instrumentation

Last updatedUpdated: by Jakub Žovák · 2 min read

Properties
created 14.04.2026, 17:00
modified 26.07.2026, 13:52
published Empty
topics OpenTelemetry, Observability
authors Empty
ai-assisted Yes
  • Language-specific libraries that instrument application code and emit telemetry ( OTel Language SDKs)
  • Available for Python, Go, Java, JavaScript/Node, .NET, Ruby, Rust, PHP, and more
  • The SDK is what runs inside your application process; the OTel Collectorruns outside

# Instrumentation Types

# Auto-Instrumentation

  • Zero code changes — hooks into frameworks and libraries automatically
  • Instruments HTTP servers/clients, DB drivers, message queues, gRPC, etc.
  • Language-specific agents or monkey-patching
    • Python: opentelemetry-instrument python app.py
    • Java: -javaagent:opentelemetry-javaagent.jar
    • Node.js: --require @opentelemetry/auto-instrumentations-node/register
  • Best for: getting started quickly, brownfield apps

# Manual Instrumentation

  • Explicitly create spans and add attributes in code
    1
    2
    3
    
    with tracer.start_as_current_span("my-operation") as span:
        span.set_attribute("user.id", user_id)
        result = do_work()
    
  • Best for: business logic context, custom attributes, fine-grained control

# Library Instrumentation

  • Pre-built plugins for popular libraries (requests, sqlalchemy, flask, express, etc.)
  • Import and register alongside the SDK

# SDK Components

  • TracerProvider — factory for creating Tracer instances
  • MeterProvider — factory for creating Meter instances (metrics)
  • LoggerProvider — factory for creating Logger instances
  • Propagators — handle context injection/extraction across process boundaries (see Context Propagation)
  • Exporters — send data to Collector or directly to backends via OTLP

# OTLP (OpenTelemetry Protocol)

  • The wire format used between SDK → Collector and Collector → backends
  • Supported transports: gRPC (port 4317) and HTTP/protobuf (port 4318)
  • Replaces vendor-specific wire formats (Jaeger Thrift, Zipkin JSON, etc.)
  • All major backends now accept OTLP natively