What OpenTelemetry is and is not
OpenTelemetry is an open source, vendor- and tool-agnostic observability framework for generating, collecting and exporting telemetry such as traces, metrics and logs. It is not an observability backend. [1]
Storage, querying, dashboards and visualization are intentionally left to other tools, allowing the same instrumentation layer to work with different backends. [1]
Traces, metrics, logs and baggage answer different questions
| Signal | What it describes | Typical question |
|---|---|---|
| Traces | A request path across components | Where and why did this request slow down? |
| Metrics | Aggregated system measurements | Is latency or error rate increasing? |
| Logs | Detailed event records | What exactly happened at this moment? |
| Baggage | Context propagated across processes | How can extra context travel with a request? |
OpenTelemetry separates signals because each describes the system from a different angle. A trace follows a request, a metric is a runtime measurement and a log records an event. [2]
Baggage carries key-value context alongside execution context. It can be consumed downstream but is not an OTLP-exported signal like traces, metrics and logs. [2][16]
Trace, span and distributed request context
A distributed trace is built from spans representing units of work. Context propagation carries trace ID and parent information across services so new spans belong to the same trace. [3]
This is what lets a request crossing several services be analyzed as one causal flow rather than unrelated timings. [3]
Metrics: cheap numbers until cardinality explodes
Metrics represent measurements such as request counts, operation duration, request sizes, CPU usage or active operations. [12]
Cardinality is the number of unique attribute combinations. OpenTelemetry warns that values such as user IDs or raw URL paths can create high cardinality and memory pressure. The Metrics SDK has a cardinality limit and overflow is represented with otel.metric.overflow=true. [12]
Logs become more useful with trace ID and span ID
The OpenTelemetry log model can include TraceId and SpanId in LogRecord, allowing a backend to connect a log to the trace and span that produced it. [13]
LogRecords can also carry Resource information, giving logs the same source identity model used by traces and metrics. [13]
Context propagation and baggage: what crosses service boundaries
Context propagation carries correlation data such as trace ID, parent ID and trace flags between execution units. [3]
Baggage can propagate additional key-value data downstream and make it available to traces, metrics or logs. Because it crosses service boundaries, it should not be used casually for secrets or unnecessary sensitive data. [2][3]
Resources and Semantic Conventions create a shared telemetry language
A Resource describes the entity producing telemetry, such as a service, process, container, pod or cloud environment. OpenTelemetry recommends setting service.name explicitly because SDKs can otherwise use unknown_service. [8]
Semantic Conventions define common attribute and operation names for traces, metrics, logs, resources and other telemetry domains. [7]
Code-based and zero-code instrumentation complement each other
OpenTelemetry supports code-based instrumentation through APIs and SDKs and zero-code approaches. Depending on the language, zero-code may use agents, monkey patching, bytecode manipulation or eBPF. [9][10]
Zero-code is useful for common libraries and application boundaries such as HTTP, database or messaging. Custom business logic usually requires code-based instrumentation when business spans or custom metrics are needed. [9][10]
OTLP: a common telemetry transport protocol
OpenTelemetry Protocol defines encoding, transport and delivery between telemetry sources, Collectors and backends. OTLP is stable for traces, metrics and logs. [6]
OTLP defines gRPC and HTTP transports. OTLP/HTTP can carry binary Protobuf or JSON-mapped Protobuf, with standard paths including /v1/traces, /v1/metrics and /v1/logs. [6]
Collector: receiver -> processor -> exporter
| Component | Role |
|---|---|
| Receiver | Receives or scrapes telemetry. |
| Processor | Transforms, filters, enriches, batches or samples data. |
| Exporter | Sends data to a backend or another Collector. |
| Connector | Bridges two pipelines as exporter and receiver. |
| Extension | Adds capabilities outside the core data path. |
The OpenTelemetry Collector can receive telemetry, process it and export it to one or more destinations. A pipeline has one or more receivers, optional processors and one or more exporters. [4]
Receivers ingest data, processors transform, filter or sample it, exporters send it onward, connectors bridge pipelines and extensions provide auxiliary capabilities such as health endpoints. [4][5]
Direct export, agent, gateway and agent-to-gateway
| Pattern | When it fits | Main trade-off |
|---|---|---|
| SDK -> backend | Small system and simple start. | Application owns export destination configuration. |
| SDK -> local agent | Telemetry per host, pod or workload. | More Collector instances to operate. |
| SDK -> central gateway | Central processing and one OTLP endpoint. | Gateway becomes critical infrastructure. |
| Agent -> gateway | Larger environments, sampling and multiple backends. | More complexity but better separation of concerns. |
A small application can export OTLP directly to a backend, but a Collector centralizes processing, routing and destination configuration. [1][4]
At larger scale, agents can run near workloads while gateways centralize heavier tasks such as sampling, batching and export. OpenTelemetry describes agent-to-gateway as a pattern for separation of concerns, cost control and stable egress. [15]
Sampling: fewer traces do not necessarily mean less insight
Sampling reduces the number of traces processed and exported. OpenTelemetry describes it as one way to lower observability cost while retaining representative data. [11]
The Collector includes probabilistic and tail sampling processors. Tail sampling can decide after more of a trace is visible, but the architecture must route spans of the same trace consistently. [11][15]
Connecting metrics to traces with exemplars
An exemplar is an individual metric measurement associated with context and can include trace ID and span ID. One use is navigating from an aggregated metric to a representative trace. [14]
This can connect a latency spike in a histogram to a specific request, provided the pipeline and backend preserve and support exemplars. [14]
Common OpenTelemetry implementation mistakes
A common mistake is treating OpenTelemetry as a backend rather than a telemetry layer. Another is attaching high-cardinality attributes to metrics, which can increase SDK memory and backend cost. [1][12]
Other problems include inconsistent service.name, unstable attribute naming and uncontrolled sampling. Resources, Semantic Conventions and sampling exist to make those choices explicit. [7][8][11]
A minimal production architecture
A practical starting point is HTTP and dependency instrumentation, explicit service.name, trace-context propagation and OTLP export to a Collector. The Collector can then route traces, metrics and logs to chosen backends. [3][4][6][8]
Tail sampling, transformations, additional exporters and agent-to-gateway architecture can be added later. OpenTelemetry does not require every component on day one. [4][15]
- Set a unique
service.namefor every logical service. - Use automatic instrumentation for common libraries and add custom instrumentation where business context matters.
- Propagate trace context across every service boundary.
- Use OTLP as the common transport where practical.
- Keep separate Collector pipelines for traces, metrics and logs.
- Control metric cardinality before high-volume production rollout.
- Introduce sampling after measuring real telemetry volume and diagnostic needs.
- Monitor the Collector itself and treat its configuration as production infrastructure.
