1. A single standard for telemetry #
Where OpenTelemetry comes from and what it standardizes.
Origins #
OpenTelemetry (OTel) was born in 2019 from the merger of two competing projects, OpenTracing and OpenCensus. Hosted by the CNCF, it has become the foundation's second most active project after Kubernetes. It neither stores nor displays anything: it standardizes how telemetry is produced and transported, which you then send to the backend of your choice.
| OpenTelemetry provides | OpenTelemetry does not provide |
|---|---|
| a specification, APIs and SDKs for about ten languages | a telemetry database |
| the OTLP protocol | dashboards or an alerting engine |
| the Collector (reception, processing, export) | an analysis tool: that is the role of Grafana, Jaeger, Elastic, Datadog, Dynatrace… |
| semantic conventions (common attribute names) |
The four signals #
| Signal | Answers | Specification status |
|---|---|---|
| Traces | where did this request go and where did it lose time? | stable |
| Metrics | how much, how fast, is it normal? | stable |
| Logs | what exactly happened at that moment? | stable (data model and SDK) |
| Profiles | which function consumes CPU or memory? | in development (alpha) |
Baggage complements these signals: key-value pairs propagated from one service to the next (customer or tenant identifier) that each service can read and add to its telemetry.
2. The building blocks #
API, SDK, resource, scope and context.
API and SDK #
This separation lets library authors (web frameworks, HTTP clients, database drivers) instrument their code once and for all, without imposing a backend or a heavy dependency on their users.
Resource and instrumentation scope #
| Notion | Describes | Examples |
|---|---|---|
| Resource | the entity producing the telemetry: identical for all signals of a process | service.name, service.version, deployment.environment.name, host.name, k8s.pod.name |
| Instrumentation scope | the library that produced a piece of data | opentelemetry.instrumentation.flask 0.48b0, or the name of your module |
| Attributes | context specific to a piece of data | http.request.method, http.response.status_code, db.system.name |
Common mistake: Withoutservice.name, SDKs useunknown_service: your data becomes impossible to find. It is the first attribute to define.
Context and propagation #
The context carries the active trace and span identifiers within a process; propagation passes it from one process to another (HTTP traceparent header, gRPC metadata, Kafka message headers). This is what makes it possible to assemble a distributed trace and link logs and metrics to the trace that produced them.
3. Configuring #
Environment variables and declarative configuration.
OTEL_* variables #
All SDKs share the same environment variables: an application is configured the same way whatever its language.
export OTEL_SERVICE_NAME=checkout
export OTEL_RESOURCE_ATTRIBUTES=service.version=1.4.0,deployment.environment.name=production
export OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4318
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
export OTEL_TRACES_EXPORTER=otlp OTEL_METRICS_EXPORTER=otlp OTEL_LOGS_EXPORTER=otlp
export OTEL_TRACES_SAMPLER=parentbased_traceidratio OTEL_TRACES_SAMPLER_ARG=0.2
export OTEL_PROPAGATORS=tracecontext,baggageGood practice: In development, OTEL_TRACES_EXPORTER=console prints spans in the terminal: the fastest way to check an instrumentation.Declarative configuration #
For complex cases (several exporters, metric views, composite samplers), OpenTelemetry defines a YAML configuration file common to all SDKs, referenced by an environment variable (OTEL_CONFIG_FILE, formerly OTEL_EXPERIMENTAL_CONFIG_FILE). Support varies by language: check your SDK's documentation.
4. Reading maturity #
Not confusing stable with experimental.
Stability levels #
| Level | Meaning | In production |
|---|---|---|
| Development / Experimental | can change or disappear without notice | avoid, or isolate |
| Alpha | functional, API still subject to change | for early adopters |
| Beta | close to stable, rare changes | with caution |
| Stable | guaranteed compatibility | yes |
Maturity is read per signal, per language and per component: Java traces have been stable for a long time, logs in another language may still be in beta, a Collector receiver may be in alpha. The « Status » pages on opentelemetry.io and the metadata.yaml file of each Collector component are authoritative.
Good to know: Instrumentation package versions ending inb0(Python) or-alpha(Java) indicate semantic conventions that are not yet stable for that library.
My progress
Sign in to track your progress and take notes. Sign in
💬 Recent discussions about this course
- Quels attributs utiliser pour nommer mes spans HTTP (semconv) ?✓ solved · 1 reply(ies)
- OpenTelemetry Collector : mes traces arrivent mais pas mes métriques✓ solved · 2 reply(ies)
Ask a question about this lesson →See all discussions about this course
Recommended Articles
OpenTelemetry: automatic vs manual instrumentation
Understand the differences between automatic and manual instrumentation with OpenTelemetry, their...
Sending traces to Tempo: OpenTelemetry instrumentation and Alloy
Produce and route traces to Tempo: Python/Java/Node auto-instrumentation, the manual SDK, OTEL en...
OpenTelemetry on Kubernetes: Operator, auto-instrumentation and Collector
Deploy OpenTelemetry on Kubernetes: Collector deployment modes (DaemonSet, Deployment, sidecar, S...
Capstone project: the four signals of the OpenTelemetry Demo in the Grafana stack
A capstone project spanning the observability courses: deploy the OpenTelemetry Demo, send metric...
Instrumenting applications for Jaeger with OpenTelemetry
Send traces to Jaeger with OpenTelemetry: auto-instrumentation (Java, Python, Node.js), SDK and m...
OTLP explained: understanding the OpenTelemetry protocol
The OTLP protocol explained simply. Understand the differences between gRPC and HTTP for exportin...
Profiles, OpenTelemetry's fourth signal: continuous profiling and correlation with traces
Understand OpenTelemetry's new profile signal: continuous profiling, flame graphs, data model and...
OpenTelemetry and Dynatrace: OTLP, collector and instrumentation
Integrate OpenTelemetry with Dynatrace: OTLP endpoint and tokens, Dynatrace OTel Collector, trace...
Correlating traces, metrics, logs and profiles with OpenTelemetry
Link the four signals to diagnose quickly: shared resource, trace_id in logs, exemplars on metric...