What is OpenTelemetry? How telemetry is collected and sent
Learn how OpenTelemetry uses APIs, SDKs, the Collector, and OTLP to move traces, metrics, and logs to a compatible backend such as Guance.
A latency chart tells you that requests slowed down. A trace can show where they spent the extra time. An application log may explain what happened there. Getting those three signals out of a service and into an analysis tool takes several pieces of software, especially when the services run on different stacks.
OpenTelemetry (OTel) is a CNCF open-source framework for generating, collecting, and exporting telemetry. It grew out of OpenTracing and OpenCensus. Its APIs, SDKs, Collector, and OTLP protocol give applications a common way to send telemetry to compatible backends.
OpenTelemetry at a glance
- OTel covers how telemetry is produced and moved. A backend handles long-term storage, queries, and analysis.
- The main pieces are the specifications and semantic conventions, language APIs and SDKs, the Collector, and OTLP.
- OTLP is stable for traces, metrics, and logs. SDKs, instrumentation libraries, and Collector components have their own stability levels.
- Start with one signal from one service. That gives you a short path to verify before you add more components.
What is telemetry?
Telemetry is the data a system emits about what it is doing. Logs record individual events. Metrics summarize measurements over time. Traces follow operations across a request path. Logs, metrics, and traces explains what each signal can answer. Profiles can show where resources such as CPU time go. When the instrumentation speaks only to a particular backend, changing backends can also mean changing how you collect the data.
What problems does OpenTelemetry solve?
- Backend coupling. Instrumentation can stay in place when the new destination accepts the same signals. Check the export settings, field mappings, and backend features before switching. Dashboards and alert rules still belong to the backend.
- Different field names across languages. Java, Go, Python, and Node.js services can use a common data model. The fields you receive depend on the instrumentation in use and the semantic conventions it follows.
- Repeated instrumentation work. Automatic instrumentation can capture common operations in supported frameworks and libraries. Add a span through the API when you need to see a business operation it does not cover.
- Disconnected requests. Services propagate trace context so related spans can form one trace. Which spans you can query also depends on sampling, export, and retention.
The main OpenTelemetry components
Specifications and semantic conventions
The specifications define data models and API behavior. Semantic conventions give common operations and resources shared attribute names and meanings. For example, an HTTP span can carry http.request.method, while service.name identifies the service resource. Look at the emitted fields before relying on the same query across services.
API and SDK
An instrumentation library can depend on the API to create spans or record measurements. The application supplies and configures the SDK that processes and exports the data. That includes sampling traces, aggregating measurements, and associating resource information. An application can connect its logging framework through a supported bridge. Installing the SDK alone leaves that log path to be configured.
Collector
The OpenTelemetry Collector is a vendor-neutral pipeline. Receivers take data in, optional processors filter or modify it, and exporters send it to their configured destinations. The components you choose determine which formats, queues, and retries are available. A queue can fill up during an outage, and a retry window can expire.
OTLP
The OpenTelemetry Protocol defines how telemetry is encoded and transmitted. It supports gRPC with Protobuf and HTTP with binary Protobuf or, where both ends support it, JSON encoding. The standard default ports are 4317 for gRPC and 4318 for HTTP. An OTLP/HTTP endpoint usually has a signal path such as /v1/traces. Check the receiving service for its actual port and routes. See the OTLP guide (Simplified Chinese) for the protocol details.
Which parts are stable?
The OTLP specification marks trace, metric, and log transport as Stable. Profiles are still in Development. These labels describe the protocol. A language SDK, an automatic instrumentation library, or a Collector receiver or exporter can be at a different stage. Check the language API and SDK status table and the documentation for the exact components you plan to run.
Where OpenTelemetry gets complicated
- Several moving parts. It is easy to spend time on Collector configuration before seeing a single span. If your stack supports automatic instrumentation, trace one service first and verify the fields it sends.
- Uneven support. The runtime, library, and signal you need may have a different support level from the one in a quickstart. Check the versions you deploy.
- A separate backend decision. The same instrumentation can feed multiple compatible backends. Retention, querying, access controls, and alerting still depend on the backend you choose.
Sending telemetry to an analysis backend
An application or Collector can send OTLP to the DataKit OpenTelemetry input to use the data in Guance. Enable the input and the exporters for the signals you need. Then verify network reachability from the sender. The sample gRPC listener at 127.0.0.1:4317 is reachable only within the same network namespace.
For HTTP, DataKit uses http/protobuf and defaults to port 9529. Its default routes are /otel/v1/traces, /otel/v1/metrics, and /otel/v1/logs. When you configure a signal-specific endpoint, provide the full URL. With the shared OTEL_EXPORTER_OTLP_ENDPOINT in a conforming HTTP exporter, use the base URL ending in /otel for those default routes. The exporter appends the signal path.
Use a request you can identify to check the service name and the parent–child span relationship. Make a known change to a metric and check its value, unit, and cumulative or delta semantics. For logs, verify the event time, severity, and correlation identifiers. Once you can query the data as expected, use it in a dashboard or a detection rule.
Frequently asked questions
How does OpenTelemetry work with Prometheus? Prometheus commonly scrapes and stores metrics, runs PromQL queries, and evaluates alerting rules. OpenTelemetry covers the generation and transport of multiple signals. A Collector pipeline can use a Prometheus receiver or exporter for metrics. Check the conversion and labels before comparing queries. See OpenTelemetry vs Prometheus (Simplified Chinese).
Do I still need a monitoring platform? You need a backend for capabilities such as retention, queries, visualization, alerts, and permissions. Guance can receive supported OTLP signals through DataKit.
Can I use OpenTelemetry with a legacy application? Yes, when its runtime and libraries are supported. For example, the Java Agent can instrument supported libraries without editing the application source. You still need to configure startup and export settings and restart the application as your deployment requires. Add spans manually for operations that automatic instrumentation misses.
Can OpenTelemetry logs replace ELK? OTel can handle parts of log collection and delivery. Indexing, search, and analysis still need a backend. After sending OTLP logs to DataKit, you can correlate a log with a trace when the log carries the matching identifier and the trace is available to query.
Further reading
- Previous: eBPF observability explained
- Next: OpenTelemetry Collector
- Related: OTLP (Simplified Chinese) · OpenTelemetry SDK · Observability guides
References: OpenTelemetry project documentation · OTLP specification · Guance OpenTelemetry integration · Guance APM · DataKit documentation
Contact us
Join the community
to join the community
Try Guance
Start online and pay only for what you use.
Get startedChoose a Guance plan
