OpenTelemetry Collector
OpenTelemetry Collector is a vendor-neutral service for receiving, processing, and exporting telemetry.
Why consider OpenTelemetry Collector?
A vendor-agnostic component that receives, processes, and exports telemetry data such as traces, metrics, and logs.
Learn OpenTelemetry Collector by building
Practical setup notes, real use cases, and copy-ready examples in one focused guide.
In this guide3 sections
Understanding the Telemetry Fragmentation Problem
When deploying microservices or distributed applications, managing observability data can quickly become a significant operational burden. Different tools emit different formats, and sending them to various observability backends often requires deploying multiple agents per node. The OpenTelemetry Collector offers a vendor-agnostic implementation on how to receive, process and export telemetry data. By providing a unified approach, it removes the need to run, operate and maintain multiple agents/collectors in order to support open-source telemetry data formats to multiple open-source or commercial back-ends.
This architecture centralizes data handling. The OpenTelemetry Collector receives telemetry such as traces, metrics, and logs, processes it, and forwards it to one or more observability backends through its component pipeline. Consequently, developers can switch monitoring platforms without altering the instrumentation code within their applications. Furthermore, this code base is currently built against using OTLP protocol v1.10.0, ensuring a stable interface for applications that rely on standard OpenTelemetry protocol definitions.
Starting the OpenTelemetry Collector Locally
To understand how the component pipeline works in practice, you can run a local instance of the Collector using Docker. This environment allows you to simulate telemetry generation and observe how the Collector handles incoming traces.
First, pull the official Docker image. This specific image version matches the getting started documentation and provides the core OpenTelemetry Collector distribution:
docker pull otel/opentelemetry-collector:0.158.0Once the image is available locally, you can start the Collector. The following command exposes the necessary ports for both gRPC and HTTP OTLP ingestion, as well as a local debugging interface called ZPages. It also routes the standard error stream to a text file, allowing you to inspect the ingestion logs.
docker run \ -p 127.0.0.1:4317:4317 \ -p 127.0.0.1:4318:4318 \ -p 127.0.0.1:55679:55679 \ otel/opentelemetry-collector:0.158.0 \ 2>&1 | tee collector-output.txtThis local container will run in the foreground. It binds to local host to restrict access strictly to your local machine.
Simulating and Verifying Telemetry Ingestion
With the Collector running, you need a way to generate telemetry data. The OpenTelemetry project provides a utility called telemetrygen that simulates an application sending traces, metrics, or logs.
In a new terminal window, you can install the utility using the Go toolchain. This step requires a recent version of Go installed on your system.
go install github.com/open-telemetry/opentelemetry-collector-contrib/cmd/telemetrygen@latestAfter the installation completes, use the generator to emit sample traces to the Collector. By default, this utility will send OTLP data to the local gRPC port that you exposed when launching the Docker container.
To verify that the Collector processed the simulated data, switch back to the terminal where the Docker container is running or inspect the output text file. You should see log entries detailing the ingested spans, including the trace identifiers, names, and timestamps. This confirms that the entire pipeline—from the receiver handling the incoming OTLP requests to the processor and the logging exporter—is functioning correctly. For further exploration, you can access the built-in ZPages debugging UI to observe internal metrics and trace configurations visually.
By abstracting the extraction and routing of observability signals, the OpenTelemetry Collector dramatically simplifies infrastructure management. Instead of configuring multiple proprietary agents for metrics, logging, and tracing separately, platform teams can standardize on a single daemon. This unified pipeline design reduces overhead, streamlines troubleshooting, and minimizes the risk of resource contention on host machines, providing a robust foundation for modern cloud-native observability.
Related tools
More options with a similar category or technology profile.
diskus
Minimal, fast alternative to du -sh written in Rust using multi-threaded directory traversal.
peco
Simplistic interactive filtering tool for Unix pipelines, process lists, and file trees.
Dapr CLI
Command-line tool for managing Dapr distributed application runtime environments and sidecars.
Freeze
Generate beautiful image screenshots and SVGs of code snippets and terminal outputs.