OpenTelemetry Collector
The Collector is a network service application that you can use to batch and transform telemetry data. It acts as a proxy and can receive OTLP requests as well as data from other sources, transform these requests according to defined rules, and forward them to the backend.
In addition to the standard vanilla build of the Collector provided by OpenTelemetry, there are customized builds with additional features available from third parties.
Advantages of using the Collector
In general, using the Collector alongside your service can be an advantage, since it allows your service to offload data quickly and takes care of additional handling such as retries, batching, encryption, or sensitive data filtering. It centralizes common processing tasks instead of duplicating them in each application.
You should use the Collector if:
- You need a vendor-agnostic way to collect data from different data sources in different formats and you need an easy way to make them all deliver their data to a backend that would otherwise be incompatible.
- You want to use tail-based sampling, meaning that the sampling decision is delayed until all spans of the trace are collected. The role of the collector here is buffering and grouping spans by trace ID.
- You need to have common processing of attributes on your telemetry data.
The Collector is a relatively lightweight component, so teams can deploy their own to avoid sharing the same configuration.
The Collector is configured in a single YAML file. This eliminates the need to browse through multiple files and reduces maintenance.
Components
Receiver
A receiver is a component that enables data to come into the Collector. It can receive data from multiple sources. Many receivers come with default settings and do not need much configuration.
For a list of available receivers and their basic configuration, see the official OpenTelemetry documentation on receivers.
Processor optional
A processor is an optional component that decides what to do with the data.
For a list of available processors and their basic configuration, see the official OpenTelemetry documentation on processors. OpenTelemetry has a list of recommended processors, but these are optional.
Exporter
An exporter is a component that sends processed data to one or more backends. Exporters can support more than one data source.
Because many exporters require additional configuration (for example, an endpoint), be sure to check the official OpenTelemetry documentation on exporters for a list of available exporters and their configurations.
Services
Services are used to define pipelines that channel data through the Collector. They define which components work together to process OpenTelemetry data.