



- Standardized contracts (tracer, meter, logger interfaces).
- A minimal no-op (NOP) implementation so instrumentation is safe even if no SDK is installed.
- The ability to plug in a full SDK later for sampling, processing, and exporting—without changing instrumented code.

trace.get_tracer() or meter.get_meter() succeed and return functional objects. Spans and metrics created in this state are no-op (silently discarded). This design makes library and framework instrumentation safe: instrumentation remains present but harmless if the application never configures an SDK.
API vs SDK — responsibilities comparison
- API: defines the “what” — interfaces for creating and managing spans, metrics, logs, and context propagation.
- SDK: defines the “how” — sampling, batching, exporting, and advanced processing.
- Sampling policies to limit telemetry volume.
- Batching spans and metrics for efficient export.
- Exporters that send telemetry to collectors or observability backends.


- Instrumentation patterns remain similar across languages while staying idiomatic.
- Exporters or SDK implementations can be swapped without touching instrumentation code.
- Application owners choose SDK configuration (exporters, samplers, processors) at deployment time.

- Depend only on the OpenTelemetry API.
- Obtain tracer/meter from the global provider (safe when SDK is absent).
- Propagate and respect context across call paths.
- Use official semantic conventions for spans and attributes: https://opentelemetry.io/docs/reference/specification/semantic_conventions/
- Leak SDK classes or types in public library signatures.
- Configure exporters, samplers, or processors inside library code.
Library authors: prefer API-only instrumentation. This ensures your instrumented library works regardless of which SDK or exporter the application selects.
Do not configure SDK components (exporters, processors, samplers) inside libraries. SDK setup belongs to the application or deployment environment.


- Python:
start_as_current_span() - Java:
SpanBuilder().startSpan() - JavaScript:
tracer.startSpan() - Go: language-idiomatic start functions
- Instrumentation authors: use the API to generate telemetry (spans, metrics, logs). API stability minimizes churn for authors.
- Application owners: configure the SDK at deployment time—choose sampling, exporters, and processing strategies.
- Plugin/SDK authors: implement exporters, processors, and samplers to connect telemetry to backends or to transform/filter data.


- What is the primary purpose of the OpenTelemetry API?
- Options: Export telemetry to backends; provide language-specific SDKs; define the interface for creating telemetry; collect and store telemetry locally.
- Correct: Define the interface for creating telemetry data (traces, metrics, logs). Exporting is handled by SDKs/plugins.

- In OpenTelemetry, what does a tracer object do?
- Options: Collect metrics; export spans; create and manage spans; aggregate logs.
- Correct: Create and manage spans to trace operations. Exporting is done by SDK/exporters.
- Which statement about OpenTelemetry API and SDK is correct?
- Options: API and SDK are tightly coupled; Applications only use the SDK directly; The API is designed to be used independently of the SDK; The API requires a specific backend at compile time.
- Correct: The API is designed to be used independently of the SDK. It is no-op-safe.
- What happens if an application only uses the OpenTelemetry API and no SDK is configured?
- Options: Application fails to start; Telemetry is generated and exported by default; The API operates in no-op mode without errors; The API throws runtime exceptions for missing SDKs.
- Correct: The API operates in a no-op mode without errors; telemetry is discarded unless an SDK is configured.

- OpenTelemetry documentation: https://opentelemetry.io/docs/
- Python instrumentation guide: https://opentelemetry.io/docs/instrumentation/python/
- Semantic conventions: https://opentelemetry.io/docs/reference/specification/semantic_conventions/