Key takeaway
- Learn how the OpenTelemetry Collector works, which deployment pattern and distribution to choose, and what changed with Grafana Alloy and Agent.
The OpenTelemetry Collector is a vendor-agnostic service that receives, processes and exports telemetry (traces, metrics and logs) so that applications do not send data straight to each observability backend. The OpenTelemetry project recommends running a collector next to your services in production, where it handles retries, batching, encryption and filtering of sensitive data. Sending data directly to a backend is fine for a first trial or a small environment.
Grafana Alloy is one distribution of the Collector, not a separate idea. This guide covers how the Collector works, which deployment pattern and distribution to choose, what has changed since Grafana Agent reached end of life, and where governance and cost need attention. For a closer look at the Alloy distribution itself, see our guide to Grafana Alloy, and for the wider discipline see what is observability.
What is the OpenTelemetry Collector, and what does it replace?
According to the OpenTelemetry documentation, the Collector can replace multiple agents or collectors. It accepts open formats such as Jaeger, Prometheus and Fluent Bit and can send data to one or more open source or commercial backends. For enterprise teams the practical value is separation: applications emit telemetry once, and the platform team decides where it goes, what is filtered and who holds the credentials. That decoupling is what lets an organisation change backend, or run two at once, without touching application code.
How does the Collector work inside?
A Collector is assembled from five kinds of component, wired together in the service section of its configuration.
| Component | What it does | What to watch |
|---|---|---|
| Receivers | Bring telemetry in | Configuring a receiver does not enable it; it must be added to a pipeline |
| Processors | Modify or transform data before export | Order matters, because it sets the sequence of transformations; memory_limiter appears in the official examples |
| Exporters | Send data to backends | Credentials and TLS settings live here |
| Connectors | Join two pipelines, acting as exporter in one and receiver in the next | Useful when one signal feeds another pipeline |
| Extensions | Add capabilities that do not touch telemetry, such as health checks | Authentication extensions can be attached to receivers and exporters |
Pipelines are defined separately for traces, metrics and logs. Before rollout, run otelcol validate --config=<file> to check a configuration file. Sensitive fields are redacted by default when the configuration is printed. Source: OpenTelemetry Collector configuration.
Which deployment pattern should you choose?
The OpenTelemetry documentation describes several patterns. The right one depends on scale, who owns credentials and whether you need tail sampling.
| Pattern | When it fits | Trade-off |
|---|---|---|
| No collector | A first trial or a small environment | Every application manages its own exporter and credentials |
| Agent (a collector beside each application or host) | Simple setups with a clear one-to-one mapping between application and collector | Limited scalability for teams and infrastructure; inflexible for complex or changing deployments |
| Gateway, single tier | Central endpoint per cluster, data centre or region, with an external load balancer across replicas | Adds a component that can fail, and increases overall resource use and cost |
| Gateway, two tiers | Telemetry that must reach a specific collector, such as tail sampling that needs every span of a trace on one instance | Cascaded collectors add latency; the first tier uses the load-balancing exporter, routing by trace ID or service |
A gateway lets you manage credentials centrally and set policies such as filtering certain logs or sampling in one place. For metrics, keep to the single-writer principle: multiple collectors writing the same series can cause duplicate or conflicting data and out-of-order sample errors. The documentation recommends the Kubernetes attributes and resource detection processors to give resources unique identities. Sources: gateway pattern and agent pattern.
Which Collector distribution should you run?
The project publishes core, contrib, Kubernetes and OTLP distributions, and you can build your own with the OpenTelemetry Collector Builder (ocb) when you need a smaller binary or custom receivers, processors, exporters or connectors. Vendors also publish their own distributions. Source: Collector distributions.
| Option | When it fits | Current status |
|---|---|---|
| Core | The base Collector, when you need only the essential components | Official OpenTelemetry distribution |
| Contrib | You need community-contributed receivers and exporters | Official OpenTelemetry distribution |
| Kubernetes | Collection inside Kubernetes clusters | Official OpenTelemetry distribution |
| Custom build with ocb | You need a smaller binary or your own components | Built and maintained by your team |
| Grafana Alloy | You run Grafana and Prometheus tooling and want built-in Prometheus pipelines alongside OpenTelemetry | Grafana describes it as an OpenTelemetry Collector distribution with native support for Loki and Pyroscope |
The Collector as a whole has mixed stability, because each component documents its own stability level. Check the component README before you depend on it in production.
What has changed with Grafana Alloy and Grafana Agent?
Grafana states that Grafana Agent reached end of life on 1 November 2025 and tells users of its Static mode, Flow mode and Operator to migrate to Alloy (see Grafana Agent documentation). Alloy migration guides cover Grafana Agent Static, Operator and Flow, the OpenTelemetry Collector, Prometheus and Promtail. Alloy also has an OpenTelemetry Engine section in its documentation: according to Grafana, you can configure Alloy with standard OpenTelemetry Collector YAML to enable native OpenTelemetry pipelines. Sources: Grafana Alloy documentation and migration guides.
What do governance, security and cost look like?
The collector sits on the path of every signal, so it is also where policy can be enforced. The OpenTelemetry documentation recommends TLS, or mTLS for mutual authentication, in production, and notes that example configurations bind to 0.0.0.0 for convenience while the Collector itself defaults to localhost. Review binding before any shared deployment. A gateway keeps credentials out of individual applications and gives one place to filter sensitive data.
On cost, each extra tier adds resource use and latency, and a gateway is one more component to run and monitor. As AI agents begin to emit traces of their own, the same pipeline becomes the evidence trail for what they did. ElixirClaw is an agentic OS platform to build, orchestrate and govern AI agents and automation workflows while keeping humans in control, and the Audit Agent assembles decision lineage, policy versions, approvals and authority chains for compliance teams. ElixirData Context OS keeps governed context, versioned policy and decision traces in one decision layer above AI agents. For the agent side of the story, read our guides to agentic observability and AI agent observability and evaluation tools.
How should you adopt it, step by step?
- Start with one collector receiving OTLP from a single service and exporting to your existing backend.
- Validate each configuration with
otelcol validatebefore deployment, and enable TLS. - Add processors one at a time, keeping their order deliberate, and add
memory_limiteras in the official examples. - Move to agent collectors on nodes where per-host collection is needed, and a gateway where you want central credentials and policy.
- Add a second tier only if you need tail sampling or other routing that keeps related telemetry together.
- If you still run Grafana Agent, plan the move to Alloy using the migration guides.
When is the Collector, or Alloy, the wrong choice?
For a small environment or a first trial, direct export to a backend needs fewer moving parts. A gateway adds a component that can fail, extra latency and cost. If your estate is built around Grafana and Prometheus, Alloy is a natural fit; if you want the upstream distributions and their component set, run core, contrib or a custom build. Compare vendors in our overview of observability companies before committing to a backend.
To map one observability decision your agents should make, and the context and policy it depends on, book a Context Workshop. See what happens in the workshop.
Frequently Asked Questions (FAQs)
What does the OpenTelemetry Collector do?
It receives, processes and exports telemetry data, and the OpenTelemetry project says it can replace multiple agents or collectors while supporting open formats such as Jaeger, Prometheus and Fluent Bit.
Is Grafana Alloy the same as the OpenTelemetry Collector?
No. Grafana describes Alloy as an OpenTelemetry Collector distribution with built-in Prometheus pipelines and native support for Loki and Pyroscope.
When should we use a gateway collector?
Use a gateway when you want central credential management and policies such as filtering or sampling in one place. Use two tiers when tail sampling needs every span of a trace on the same collector.
Is Grafana Agent still supported?
Grafana states that Grafana Agent reached end of life on 1 November 2025 and advises users of Static mode, Flow mode and Operator to migrate to Grafana Alloy.
How do we check a Collector configuration before rollout?
Run otelcol validate --config with your configuration file. Remember that a configured component is only active once it is added to a pipeline in the service section.
Follow XenonStack on LinkedIn: XenonStack on LinkedIn for new guides on agentic AI, data and platform engineering.
Explore the XenonStack platform family: ElixirData · ElixirClaw · ElixirHub · NexaStack · MetaSecure · Neural AI · AgentGRC · AgentSRE · AgentAnalyst · AgentInstruct · AgentRAI · AgentScrum · AgentSearch · AgentForce · AI Aviator · SAIF Aviator · CohortIQ · XenonStack AI · XenonStack UAE