OpenTelemetry Standards
OpenTelemetry standards
This domain tests practical knowledge of OpenTelemetry (OTel): the API/SDK/Collector split, OTLP, semantic conventions, context propagation, and when to use agent versus gateway collectors.
What OTel is
A CNCF project created in 2019 by merging OpenTracing (API-only) and OpenCensus (SDK plus agent). It standardises vendor-neutral APIs, SDKs and a Collector across traces, metrics and logs, with profiles still maturing.
The component model
- API - stable interfaces that libraries code against; a no-op implementation is used when no SDK is registered.
- SDK - the real implementation: samplers, span processors, exporters, resource detection, configured per language.
- Collector - a standalone service chaining receivers, processors and exporters into pipelines.
- OTLP - the wire protocol; gRPC on 4317, HTTP/protobuf on 4318.
Semantic conventions
Shared attribute names keep backends queryable: service.name (required on every resource), http.request.method, http.response.status_code, db.system, server.address, k8s.pod.name. Span names must be low-cardinality - GET /users/{id}, never a raw ID, or every span becomes its own metric series.
Collector placement
Agent collectors (DaemonSet or sidecar) sit near workloads for batching, retry and Kubernetes metadata enrichment. Gateway collectors centralise tail sampling, PII redaction and fan-out to multiple backends. You are not required to run a Collector, but most production designs do.
Worked example
A Java service must emit traces with no code changes. Deploy the OTel Java agent (-javaagent), set OTEL_SERVICE_NAME and OTEL_EXPORTER_OTLP_ENDPOINT to a local agent, let the agent attach k8s.* attributes, and send to a gateway that keeps 100% of error traces and 10% of the rest. Reasoning: auto-instrumentation covers HTTP, JDBC and messaging; add manual spans only for business operations the frameworks cannot see.
Traps
- Assuming the API does anything on its own without an SDK.
- Forgetting resource attributes, so everything lands under
unknown_service. - High-cardinality span names or raw URL paths in attributes.
- Believing the Collector is mandatory, or that it replaces SDK configuration.