Why does OpenTelemetry separate the API from the SDK?

AdvancedConceptTracing & OpenTelemetry
Answer

So that libraries can depend on the API without forcing a telemetry implementation on the application.

  • A library (an HTTP client, an ORM) calls the API to create spans. If the application never installs an SDK, the API is a no-op: near-zero overhead, no exporter, no surprises.
  • The application owner chooses and configures the SDK: samplers, exporters, resource attributes.
  • The API is kept very stable (backward compatible), while the SDK can evolve.

This is why it is safe for library authors to ship native OTel instrumentation and why you never call SDK classes from shared library code. It also lets you swap SDK configuration (or even a vendor distro) without recompiling libraries.

All Monitoring & Observability questions Roadmap: Logging & tracing

More on Tracing & OpenTelemetry