OpenTelemetry defines a vendor-agnostic model for telemetry signals: traces, metrics, logs, and baggage. Each signal follows a consistent layering pattern — Instrumentation, Semantic Conventions, API, SDK, and Contrib — which separates the contract from runtime behavior and integrations.
- OpenTelemetry (https://opentelemetry.io/) standardizes telemetry signals (traces, metrics, logs) and cross-process baggage.
- For each signal you typically have:
- Instrumentation — application or framework code that emits telemetry.
- Semantic conventions — standardized attribute/metric/log keys and meanings.
- API — the public contract used by instrumentation to create telemetry.
- SDK — runtime implementation that handles sampling, aggregation, batching, and exporting.
- Contrib — integration packages, auto-instrumentation, and vendor exporters.
| Signal | Instrumentation | Semantic Conventions | API | SDK | Contrib / Examples |
|---|---|---|---|---|---|
| Traces | Create and end spans in application code | http.method, db.statement | Tracer API to create/manage spans | Sampling, batching, exporting spans | Auto-instrumentation, exporters (e.g., Jaeger) |
| Metrics | Emit counters/histograms/gauges | http.server.duration, process.cpu.time | Meter API for counters/histograms/gauges | Aggregation, temporality, export | Prometheus exporters/instrumentation |
| Logs | Emit structured log records | log.record.original, log.file.path.resolved | Logger API for structured logs | Processing, enrichment, batching, export | Fluentd exporters, bridges |
| Baggage | Attach key/value pairs to contexts | Naming conventions for keys | Baggage API for get/set | Propagation storage and context management | Propagators (B3, Jaeger, W3C Trace Context) |
- Instrumentation: application code or instrumented libraries create spans representing operations.
- Semantic conventions: standard attributes such as
http.methodanddb.statementensure consistent meaning across services and languages. - Tracer API: the stable contract libraries and apps call to create and manage spans.
- SDK: implements runtime behavior — sampling policies, span processors (batching/exporting), and the exporter to backends.
- Contrib: integration packages and exporters (for example, Flask instrumentation or Jaeger exporter).
- Emitted similarly to traces, but as numerical time-series.
- Semantic conventions: standard metric names (e.g.,
http.server.duration) and units. - Meter API: defines counters, histograms, and gauges as the instrumentation contract.
- SDK: implements aggregation, temporality, and exporting of metric data.
- Contrib: exporters and integrations such as Prometheus instrumentation.
- Application code and frameworks can emit structured logs as a first-class signal.
- Semantic conventions standardize log fields to enable correlation with traces and metrics.
- Logger API: how structured logs are created and annotated.
- SDK: log processors, enrichers, batching, and exporters.
- Contrib: log exporters and bridge packages (e.g., Fluentd).
- Baggage is for propagating small, application-defined key/value pairs (for example,
user.idorsession.id) across process boundaries. - Pattern: API defines how to set/get baggage; SDK supports context storage and propagation; contrib supplies propagators and integrations (B3, Jaeger, W3C Trace Context).
- In many cases, built-in OTel propagators meet common baggage needs.
- All signals follow the same architectural pattern:
- API = “what” the instrumentation emits (stable contract).
- SDK = “how” telemetry is processed and delivered (runtime).
- Contrib = ecosystem integrations and exporters.
- This separation preserves stable instrumentation while allowing flexible runtime implementations.

Do not import or rely on SDK internals from instrumentation libraries. Instrumentation should use the OpenTelemetry API (and semantic conventions) only. The SDK can be configured by the application or platform at runtime.
- What makes OpenTelemetry a cross-cutting concern?
- It only works with front-end code.
- It provides centralized logging only.
- It is mixed into multiple parts of the application to provide observability.
- It replaces business logic in application layers.

- Which software design principle is challenged by cross-cutting concerns like OpenTelemetry?
- Inheritance
- Separation of Concerns
- Single Responsibility Principle
- Encapsulation

- What is the main purpose of the OpenTelemetry API in the client architecture?
- To export telemetry to a vendor backend?
- To define cross-cutting interfaces and constants for instrumentation.
- To store metrics in a database.
- To monitor OpenTelemetry itself.

- Which part of the OpenTelemetry client should NOT be used inside instrumentation libraries?
- Semantic conventions
- API
- SDK
- Constants

- Which of the following best describes the role of semantic conventions in OpenTelemetry?
- Provide a UI for visualizing telemetry
- Define standard attribute keys and values for consistent telemetry
- Authenticate telemetry between services
- Automatically deploy OTel agents
- OpenTelemetry: https://opentelemetry.io/
- Flask: https://flask.palletsprojects.com/
- Jaeger: https://www.jaegertracing.io/
- Prometheus: https://prometheus.io/
- Fluentd: https://www.fluentd.org/
- B3 Propagation: https://github.com/openzipkin/b3-propagation
- W3C Trace Context: https://www.w3.org/TR/trace-context/