OpenTelemetry: The Standard

What It Is, and What It Is Not

OpenTelemetry (OTel) is a CNCF project that defines how logs, metrics and traces (and, less mature, profiles) are generated, named, encoded and transported. It consists of six artifacts:

SpecificationLanguage-neutral rules: the data models, what an SDK must do, what the API must look like. The SDKs are implementations of this text.
API + SDK (per language)Two separate packages, covered below. Go, Java, Python, JavaScript, .NET, C++, Rust, PHP, Ruby and others.
Semantic conventionsThe agreed names and meanings of attributes and metrics: http.request.method, db.system.name, service.name.
OTLPOpenTelemetry Protocol: the protobuf wire format and transport for all signals.
CollectorA standalone Go binary that receives, processes and exports telemetry. It has its own part: see OTel Collector.
InstrumentationReady-made libraries and zero-code agents that call the API on your behalf for popular frameworks.

History: Why Two Projects Became One

By 2018 there were two competing open instrumentation standards. OpenTracing (CNCF) was only an API: vendor-neutral, no implementation, traces only. OpenCensus (Google, Microsoft) shipped API and implementation and covered traces plus metrics. Library authors faced a choice, and picking either split the ecosystem. In May 2019 the two merged into OpenTelemetry, taking OpenTracing's API-first separation and OpenCensus's metrics and exporters. Both predecessors were archived afterwards; anything still on them is on a dead-end migration path. Tracing went stable first (2021), metrics after, and the logs signal was built differently from the other two (see the Logs Bridge below).

The Layers: API, SDK, OTLP, Collector

The architecture matters because of one rule about dependency direction. The API is the set of interfaces application and library code calls (Tracer, Meter, Logger). The SDK is the implementation that actually samples, aggregates, batches and exports. With no SDK installed, the API is a no-op: calls compile, run and cost almost nothing. That lets a library such as an HTTP client or JDBC driver depend on the API alone and be instrumented unconditionally; only the application owner decides whether anything real is behind it. The tracing-specific treatment, including the exact no-op mechanics, is in the Distributed Tracing guide; here the point is that the same split applies to all signals.

Left to right: application code and libraries call the OpenTelemetry API, which is a no-op unless an SDK is installed. The SDK contains providers with a Resource, processors and metric readers with samplers and views, and an OTLP exporter. The exporter sends OTLP over gRPC port 4317 or HTTP port 4318 to the Collector, which has receivers, processors, exporters and connectors, and fans out to three kinds of backend: a metrics store, a trace store and a log store. A note says library authors depend only on the API, the application owner chooses the SDK, and the platform team owns the Collector and backends.
Where each OpenTelemetry layer sits, and who depends on which. Read it as: the only arrow application code ever draws is into the API. Everything to the right is configuration that can change without recompiling the services that were instrumented.

Inside the SDK: Providers, Processors, Exporters, Propagators

ComponentJobPer-signal form
ProviderThe factory and root of configuration for one signal. Holds the Resource and hands out named instruments or tracers. You build it once at startup and register it globally.TracerProvider, MeterProvider, LoggerProvider
SamplerDecides at span creation whether a trace is recorded (see the Distributed Tracing guide).Traces only
Processor / ReaderSits between instrumentation and exporter. Spans and logs: batch them (BatchSpanProcessor, BatchLogRecordProcessor) so each call is not a network round trip. Metrics: a MetricReader, typically periodic, collects the aggregated state every interval (default 60 s) and hands it on.Span/log processors, metric readers
ViewMetrics only. Rewrites an instrument's output: drop attributes, rename, change aggregation or histogram buckets.Metrics only
ExporterSerializes and sends. OTLP is the default and the one to use; others write to console or expose a Prometheus pull endpoint.One per signal
PropagatorInjects and extracts context (trace ID, baggage) into carrier headers across process boundaries. Default tracecontext,baggage (see the Distributed Tracing guide).Cross-signal, mostly used by traces

Resource: Who Produced This Data

A Resource is an immutable set of attributes describing the entity producing telemetry, attached once per provider and shipped with every batch, rather than repeated on every span, point or log line. It is how a metric from a pod becomes "payments, v2.3.1, prod, node-7". OTLP groups data as ResourceSpans → ScopeSpans → Span (likewise for metrics and logs), so resource attributes cost one copy per batch on the wire.

AttributeMeaning / source
service.nameThe logical service. Required in practice: it is the primary key backends group by. If unset, SDKs emit unknown_service (plus the process executable name), the most common reason a first dashboard looks wrong.
service.version, service.instance.idRelease being run; unique instance (so two pods do not collapse into one series).
deployment.environment.nameprod / staging. Renamed The older deployment.environment is deprecated; the current stable name has the .name suffix, and plenty of dashboards and Collector configs still key on the old one.
k8s.namespace.name, k8s.pod.name, k8s.node.name, k8s.deployment.nameUsually added by the Collector's k8sattributes processor, not the app (see OTel Collector).
host.name, cloud.provider, cloud.region, process.pidFilled by resource detectors: SDK-side or Collector-side plugins that interrogate the environment (env vars, cloud metadata endpoint, /proc, Kubernetes) at startup.

Resource attributes become labels only if the backend promotes them. Prometheus ingesting OTLP puts them on a single target_info series by default (joined in PromQL) rather than on every series, precisely to protect cardinality (see Prometheus, see Cost and vendors). Loki indexes only a configured short list of them as labels.

Semantic Conventions: Naming Is the Product

Semantic conventions (semconv) fix the names, units and value rules so that "HTTP status code" is the same key in every language and every vendor's dashboard. Without them, every team invents status, http_code, statusCode, and no cross-service query works. Stable names you should know:

AreaCurrent stable attribute / metricReplaces
HTTP requesthttp.request.method, http.response.status_code, http.route, url.path, url.query, url.full, url.schemehttp.method, http.status_code, http.target, http.url, http.scheme
Network peerserver.address, server.port, client.address, network.protocol.version, error.typenet.peer.name, net.peer.port, net.host.name, http.flavor
HTTP metricshttp.server.request.duration, http.client.request.duration (histograms, unit seconds)http.server.duration / http.client.duration (milliseconds)
Database clientdb.system.name, db.operation.name, db.collection.name, db.namespace, db.query.textdb.system, db.operation, db.sql.table, db.name, db.statement

Note the database conventions are stable as a set, but only a few values of db.system.name are (postgresql, mysql, mariadb, microsoft.sql_server); the rest are still marked development. url.path is the raw path; for low-cardinality grouping use http.route (/orders/{id}), never the path, as a metric attribute.

OTLP: The Wire Protocol

OTLP is a protobuf schema with two transports: gRPC on port 4317 and HTTP/1.1 or 2 on port 4318. Over HTTP each signal has its own path: POST /v1/traces, /v1/metrics, /v1/logs, with a protobuf body (Content-Type: application/x-protobuf) or a JSON-encoded protobuf variant (application/json, bigger and rarely worth it outside browsers). The spec's default protocol for SDKs is http/protobuf; some language SDKs historically default to gRPC, so set OTEL_EXPORTER_OTLP_PROTOCOL explicitly. Responses carry partial_success (how many items the server rejected and why); the sender retries on retryable status codes with backoff and honors Retry-After / throttling hints.

One subtlety trips people up: if you set only the general OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4318, the SDK appends /v1/traces etc. per signal. If you set a per-signal endpoint such as OTEL_EXPORTER_OTLP_TRACES_ENDPOINT, it is used as-is, so you must include the path yourself. The default export timeout is 10 s per batch, covering retries.

The Metrics Data Model

The SDK separates how you record from what you ship. You record with an instrument; the SDK aggregates into a data point stream keyed by (metric name, attribute set). The mapping:

InstrumentRecordsDefault aggregation / OTLP type
CounterNon-negative increments (requests, bytes)Sum, monotonic
UpDownCounterValues that go up and down (queue depth, active connections)Sum, non-monotonic
HistogramA distribution of measurements (latency, size)Histogram (explicit buckets) or ExponentialHistogram if configured
GaugeA point-in-time reading (temperature)Gauge, last value
Observable versions of the aboveCallback invoked at collection time (memory in use, pool size)As synchronous counterpart

Aggregation temporality: cumulative

Each data point reports the total since process start (like a Prometheus counter). A lost export is harmless: the next one carries the full total. Server needs to detect resets. Required by Prometheus-style backends.

Aggregation temporality: delta

Each point reports only the change since the last export. Cheaper for the client (no series state kept once exported) and better for short-lived processes and high-cardinality, but a lost export is lost data. Preferred by some vendors. Choose per exporter via OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE (cumulative, delta, lowmemory).

Explicit-bucket histograms use fixed boundaries you choose; the SDK default (0, 5, 10, 25, 50, 75, 100, 250, 500, 750, 1000, 2500, 5000, 7500, 10000) assumes milliseconds. Exponential histograms (the same idea as Prometheus native histograms, see Metrics and the Prometheus part) use bucket boundaries that grow by a constant factor 2^(2^-scale), so relative error is bounded across any range with no boundaries to choose. The SDK defaults are max 160 buckets and max scale 20, and it lowers the scale automatically when the observed range would need more buckets.

A View is the control point for cost: it matches an instrument by name and rewrites its stream. The one you will use most is dropping a high-cardinality attribute, or fixing buckets for second-based instruments, without touching the code that records.

// MeterProvider: resource, a 10 s periodic OTLP/HTTP reader, one View.
exp, _ := otlpmetrichttp.New(ctx) // reads OTEL_EXPORTER_OTLP_* env vars
res, _ := resource.New(ctx,
    resource.WithFromEnv(),       // OTEL_SERVICE_NAME, OTEL_RESOURCE_ATTRIBUTES
    resource.WithHost(), resource.WithProcess())

mp := sdkmetric.NewMeterProvider(
    sdkmetric.WithResource(res),
    sdkmetric.WithReader(sdkmetric.NewPeriodicReader(exp,
        sdkmetric.WithInterval(10*time.Second))),
    sdkmetric.WithView(sdkmetric.NewView(
        sdkmetric.Instrument{Name: "checkout.requests"},
        // drop user.id before it creates a series per user:
        sdkmetric.Stream{AttributeFilter: attribute.NewDenyKeysFilter("user.id")},
    )),
)
otel.SetMeterProvider(mp)
defer mp.Shutdown(ctx) // flushes the last interval

m := otel.Meter("checkout")
reqs, _ := m.Int64Counter("checkout.requests", metric.WithUnit("{request}"))
lat, _ := m.Float64Histogram("checkout.duration", metric.WithUnit("s"),
    metric.WithExplicitBucketBoundaries(.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5))

attrs := metric.WithAttributes(
    attribute.String("http.route", "/orders/{id}"),   // bounded: good
    attribute.String("user.id", uid))                 // unbounded: dropped by the View
reqs.Add(ctx, 1, attrs)
lat.Record(ctx, time.Since(start).Seconds(), attrs)

Two details in that snippet carry the lesson. The latency histogram is in seconds with matching bucket boundaries (otherwise the default millisecond buckets put every request in the first bucket), and user.id is removed in the SDK, before it can create a series. The same filtering is possible later in the Collector, but then you have already paid the CPU and network cost of producing it.

Logs: The Bridge, Not a New API

Traces and metrics came with a new API because no good one existed. For logs, every language already has an established logging library, and nobody was going to rewrite millions of log calls. So OTel's logs design is a Logs Bridge API: a thin interface intended for logging-library authors, not application code. You keep calling slog, Logback, Log4j2, logging, zap; an appender or handler attached to that library converts each record into an OTel LogRecord and hands it to the LoggerProvider. Two things happen on the way that plain file logs never get: the active span context is read automatically, so the record carries TraceId and SpanId (the join key from the Beyond the three pillars part), and the Resource is attached.

The LogRecord data model: Timestamp (when it happened), ObservedTimestamp (when collected), TraceId, SpanId, SeverityNumber (1 to 24 in six bands: TRACE 1-4, DEBUG 5-8, INFO 9-12, WARN 13-16, ERROR 17-20, FATAL 21-24) plus SeverityText, Body (any value; a string for classic logs, a structure for structured ones), Attributes, Resource and InstrumentationScope. For logs that are not produced by an OTel-aware appender (container stdout, files, syslog) the Collector's filelog receiver parses them into the same model (see OTel Collector).

Auto vs Manual Instrumentation

Auto-instrumentation adds telemetry to code you have not edited. Manual instrumentation is you calling the API for business-level spans and metrics. You nearly always need both: auto gives you the boundary (HTTP in, DB out, queue consume) and manual gives you the meaning (cart.items, payment.provider).

MechanismHowTrade-off
Java agentjava -javaagent:opentelemetry-javaagent.jar -jar app.jar; bytecode is rewritten at class-load time to wrap hundreds of librariesBiggest coverage, zero code. Startup cost, version-compatibility quirks, and it can be a surprise when it instruments something you did not expect.
Python / Node / .NET zero-codeopentelemetry-instrument python app.py, node --require @opentelemetry/auto-instrumentations-node/register; monkey-patches or hooks known libraries. Kubernetes operator can inject these via an annotation.Runtime hooks, so coverage depends on the library being patchable. Config by environment variables.
eBPF (OBI)OpenTelemetry eBPF Instrumentation, donated by Grafana (Beyla) in 2025, runs as a privileged DaemonSet and observes syscalls, TLS libraries and the network on the node. Linux kernel 5.8+ (or RHEL 4.18 with backports), BTF, amd64/arm64.No restart, no language support needed (Go, Java, Python, Node, Rust, C and more). Sees edges only: spans and RED metrics for HTTP, gRPC, SQL, Redis, Kafka. No business attributes and weak trace context propagation across hops. Needs elevated privileges.
ManualYou call tracer.Start, meter.Int64CounterThe only way to get domain semantics. Costs developer time and review discipline.

Configuration: The Environment Variables That Matter

Every SDK honors the same environment variables, which makes configuration portable across languages and injectable by the platform (Helm chart, operator) rather than coded.

VariableEffect and default
OTEL_SERVICE_NAMESets service.name; wins over the same key in OTEL_RESOURCE_ATTRIBUTES.
OTEL_RESOURCE_ATTRIBUTESComma-separated k=v list: service.version=2.3.1,deployment.environment.name=prod.
OTEL_EXPORTER_OTLP_ENDPOINT, _PROTOCOL, _HEADERS, _COMPRESSIONWhere and how to send. Per-signal variants (_TRACES_, _METRICS_, _LOGS_) override the general ones.
OTEL_TRACES_SAMPLER, OTEL_TRACES_SAMPLER_ARGDefault parentbased_always_on; e.g. parentbased_traceidratio with arg 0.05 (see the Distributed Tracing guide).
OTEL_METRIC_EXPORT_INTERVALMilliseconds between metric exports; default 60000. This is the resolution floor of your OTel metrics.
OTEL_PROPAGATORSDefault tracecontext,baggage.
OTEL_TRACES_EXPORTER / OTEL_METRICS_EXPORTER / OTEL_LOGS_EXPORTERotlp, console, none (and prometheus for metrics).
OTEL_SEMCONV_STABILITY_OPT_IN, OTEL_SDK_DISABLEDNaming migration (above); kill switch.

Maturity, as of October 2026

"OTel is stable" is true of the spec for traces and logs, partly true for metrics, and misleading in the details, because the real constraint is your language's SDK. Status values below are from the OpenTelemetry specification status page and the per-language status table, checked 2026-10-24; they change, so confirm before committing a roadmap.

SignalAPISDKOTLP protocolCaveat
TracesStableStableStableThe most mature; the cleanest to adopt first.
MetricsStableMixedStableCore is stable; newer parts (e.g. some exemplar and cardinality-limit behavior) are not uniformly so across SDKs.
LogsStable (Bridge API)StableStableSpec stable, but language support lags (below).
BaggageStableStablen/a (header-propagated)Key-value context passed to downstream services; it is sent on the wire to every hop, including third parties, so no secrets.
Profilesn/an/aDevelopmentThe concept page labels the signal Alpha. Includes an eBPF-based whole-system profiler. See Beyond the three pillars.
LanguageTracesMetricsLogs
Java, C++, .NET, PHPStableStableStable
GoStableStableRelease candidate
Python, JavaScriptStableStableDevelopment
RustBetaStableStable
Ruby, Swift, Erlang/ElixirStableDevelopmentDevelopment

Read this table as a planning input. A Python or Node shop gets stable traces and metrics but should not expect the OTel log pipeline to be the foundation yet; they typically keep structured stdout logs collected by the Collector's filelog receiver or an existing agent (see Log pipelines and storage) and link them to traces by injecting the trace ID into the log line. Collector components carry their own, separate stability levels (see OTel Collector).

The Invariants

  • Guarantees: A vendor-neutral API with a no-op default, so libraries can be instrumented once. A single wire format (OTLP) and common attribute names (semconv) across languages and backends. Resource attributes describe the producer once per batch. Backend choice is movable by changing Collector exporters, not application code.
  • Does not guarantee: Storage, querying, alerting, or retention: none of that exists in OTel. Delivery: exports are buffered and retried but ultimately best-effort, and lost on crash. Uniform maturity: signal status varies by language and by component, and semconv versions mix in a real fleet. Free cardinality: the SDK cap (2000 per instrument by default) protects the process, not your numbers; what you attach as attributes still decides the bill.