跪拜 Guibai
← All articles
Big Data

OpenTelemetry: The Standard Data Collection Layer for Distributed Systems

By 大大大大晴天 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Adopting OpenTelemetry is now the de facto way to get portable observability across Kubernetes, microservices, and big data stacks. It eliminates vendor lock-in and unifies instrumentation across languages, but it demands governance of attribute cardinality and sampling costs as soon as teams scale beyond a single service.

Summary

OpenTelemetry gives distributed systems a single, standard way to generate and ship telemetry. It defines a common API and SDK that library authors can depend on without binding applications to a specific SDK, plus a Collector that receives, processes, and routes traces, metrics, and logs to any backend. This decoupling means teams can run Jaeger, Prometheus, and OpenSearch today and swap to a commercial APM tomorrow without rewriting instrumentation.

The framework supports four signal types: traces, metrics, logs, and baggage. Traces are represented as spans forming a directed acyclic graph, which lets engineers follow a request across API gateways, Kafka, Flink jobs, and storage. The Collector pipeline is the central workhorse, with receivers, processors, and exporters that filter, batch, sample, and route data. Deployment can be as simple as app-to-backend or as layered as node agents feeding a central gateway, a pattern common on Kubernetes.

For big data platforms, OpenTelemetry bridges system observability and data pipeline observability. A slow report query gets a trace showing each service call, metrics from Flink or Trino, and logs with exception context. The article also outlines a pragmatic rollout: start with a debug exporter to validate data, then connect real backends, add business attributes like job_id and tenant_id, and finally govern sampling and label cardinality to control cost.

Takeaways
— OpenTelemetry is a vendor-neutral framework for generating, collecting, and exporting traces, metrics, and logs.
— The API and SDK are separated: libraries can depend on the stable API, while application owners manage the SDK implementation.
— The Collector pipeline uses receivers, processors, and exporters to route data to multiple backends.
— Four signal types exist today: traces, metrics, logs, and baggage, with profiles and events still in development.
— Deployment modes include no collector, a per-node agent, a central gateway, or a combined agent-gateway architecture.
— A safe rollout path is: debug exporter first, then real backends, then business context attributes, then sampling and cost control.
— Common problems include broken traces due to missing context propagation, data loss from undersized collectors, and high cardinality from unbounded attributes.
Conclusions

The API/SDK split is the key design that keeps OpenTelemetry library-friendly: a third-party library only needs to target the API, so it stays compatible with any SDK implementation.

The Collector acts like a data pipeline for telemetry, much like an ETL for logs and metrics; this makes it natural for big data engineers to reason about.

The real challenge is not collecting data but ensuring it is correct, complete, correlatable, and cheap, which is why the article emphasizes sampling and attribute governance from the start.

OpenTelemetry becomes more valuable as the system grows complex; for a single small app, the overhead may not be worth it, but for a multi-service, multi-language platform it is almost mandatory.

Concepts & terms
Traces
A record of a request's path through distributed services, composed of spans.
Spans
The fundamental unit of a trace, representing a single operation with a start and end time.
OTLP
OpenTelemetry Protocol, the standard wire format for exporting telemetry.
Collector
A process that receives, processes, and exports telemetry data to backends.
Baggage
Key-value pairs propagated across services to carry business context.
Instrumentation
The act of adding code (or using automatic agents) to generate telemetry.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗