1. Blog
  2. OpenTelemetry Collector Gateway: Self-Hosted vs Managed
Blog

OpenTelemetry Collector Gateway: Self-Hosted vs Managed

A Collector gateway gives you one place to sample, redact and route telemetry. Here's what running one yourself involves, what managed options take off your plate, and how to choose.

The Atatus TeamPublished December 4, 20268 min read
OpenTelemetry Collector Gateway: Self-Hosted vs Managed

An OpenTelemetry Collector gateway is a central pool of Collectors that all your services and agents send telemetry to before it reaches a backend. It gives you one place to sample traces, remove sensitive data, add context and route data to one or more backends. Run it yourself when you need control over sampling, redaction and routing inside your own network. Use a managed option when your team would rather not operate, scale and upgrade another stateful service.

This guide explains what a gateway does, when you need one, what running it yourself involves, what changed in the Collector in late 2026, how managed options compare, and how to send gateway data to Atatus.

Table of Contents

What a Collector gateway does

The OpenTelemetry Collector can run in two places. As an agent, it runs on each host, or as a sidecar or DaemonSet in Kubernetes, next to your applications. As a gateway, it runs as a separate service that applications and agents send to over OTLP, usually with one endpoint per cluster, data center or region. Many teams use both: agents collect host data and add local context, and the gateway does the work that needs a central view:

  • Tail sampling. Decide which traces to keep after they finish, so you can keep every error and every slow request and only a share of the rest. This needs all the spans of a trace in one place.
  • Redaction. Remove tokens, headers and personal data once, before anything leaves your network.
  • Enrichment. Add environment, region or team attributes in one place instead of in every service.
  • Routing. Send each signal to the right backend, or copies to more than one, without touching application code.
  • One way out. Only the gateway needs outbound internet access and backend credentials, and it buffers and retries when a backend is slow or down.

Do you need a gateway?

Not always. OpenTelemetry SDKs can send straight to a backend, and a Collector agent on each host covers host metrics, logs and simple processing. A gateway starts to pay off when one of these is true:

  • You want tail sampling, so trace volume is cut without losing the traces you need.
  • You have many services, clusters or teams, and want one place to enforce redaction and naming rules.
  • You send data to more than one backend, or expect to change backends.
  • Security rules allow only a few hosts to reach the internet.

Running a gateway yourself

A self-hosted gateway is a set of Collector instances you deploy, scale, monitor and upgrade. Most gateway features, such as tail sampling, the load-balancing exporter and file storage, ship in the contrib distribution (otelcol-contrib), not the core one. Several things decide whether it runs smoothly.

Scaling and load balancing

If the gateway only filters, redacts and forwards data, every instance can handle any request, and an ordinary load balancer in front of the pool is enough. Tail sampling is different: every span of a trace has to reach the same Collector, or each instance decides on part of a trace. The usual answer is two tiers. The first tier receives everything and uses the load_balancing exporter to route spans by trace ID, and the second tier runs the tail sampling and exports to the backend.

A first tier in Kubernetes can look like this. It routes traces to the sampling tier through a headless service, and sends metrics and logs, which don't need tail sampling, straight to the backend:

receivers:
  otlp:
    protocols:
      grpc:
        endpoint: 0.0.0.0:4317
      http:
        endpoint: 0.0.0.0:4318

processors:
  memory_limiter:
    check_interval: 1s
    limit_percentage: 80
    spike_limit_percentage: 15

exporters:
  load_balancing:  # called loadbalancing in older releases
    routing_key: traceID
    protocol:
      otlp:
        tls:
          insecure: true  # plain gRPC inside the cluster; use TLS across networks
    resolver:
      dns:
        hostname: otel-sampler-headless.observability.svc.cluster.local
  otlphttp/atatus:
    endpoint: https://otel-rx.atatus.com
    headers:
      api-key: ${env:ATATUS_API_KEY}
    sending_queue:
      batch:
        flush_timeout: 200ms

service:
  pipelines:
    traces:
      receivers: [otlp]
      processors: [memory_limiter]
      exporters: [load_balancing]
    metrics:
      receivers: [otlp]
      processors: [memory_limiter]
      exporters: [otlphttp/atatus]
    logs:
      receivers: [otlp]
      processors: [memory_limiter]
      exporters: [otlphttp/atatus]

When the sampling tier scales up or down, the resolver picks up the new set of instances, and some traces are split during the change. By default the load-balancing exporter doesn't retry on another instance when one fails, so turn on its queue and retry settings in elastic environments.

Memory and back-pressure

Put the memory_limiter processor first in every pipeline. When the Collector nears its memory limit, it refuses new data, so senders back off and retry instead of the Collector running out of memory and losing everything in flight. Tail sampling holds whole traces in memory until it decides, so size the sampling tier for your trace volume and the decision_wait you choose.

Queues and retries

Each exporter has a sending queue and retry settings. The queue holds data while the backend is slow or unreachable. By default it lives in memory and is lost when the Collector restarts. To keep it across restarts, point it at the file_storage extension and give the Collector a persistent volume. Watch otelcol_exporter_queue_size against otelcol_exporter_queue_capacity, and the otelcol_exporter_enqueue_failed_* metrics, which count data dropped because the queue was full.

Monitoring and upgrades

A gateway is now part of your production path, so it needs its own dashboards, alerts and on-call owner. Collector components have their own stability levels, and some are still alpha or beta, so read the release notes before each upgrade. Configuration can change between releases: the load-balancing exporter was renamed from loadbalancing to load_balancing, with the old name kept as a deprecated alias. On Kubernetes, the OpenTelemetry Operator can deploy and update Collectors for you, but you still run them.

What changed in late 2026

On November 11, 2026, the OpenTelemetry project deprecated the Collector's batch processor. Batching now happens in each exporter's sending queue, which also gives control over sizes in bytes, concurrency and back-pressure. A new queue_batch processor covers the cases where batching in a processor still makes sense. The announced plan:

  • The batch processor starts logging a deprecation warning.
  • Exporter-level batching becomes the default in most exporters in v0.171.0, planned for February 2027.
  • The batch processor is removed from the core repository and distributions in v0.177.0, planned for May 2027.

To migrate, remove batch from your pipelines and turn on batching in the exporter's sending_queue, as the examples in this guide do. One catch: the queue now sits before batching, so it holds many small requests instead of a few large batches. Raise queue_size, or size the queue in items or bytes, so it doesn't overflow after the switch.

On the backend side, around AWS re:Invent 2026, AWS described its new CloudWatch Omni experience as OpenTelemetry-native, one more large backend built around OpenTelemetry.

Managed gateway options

Managed means someone else runs the gateway layer for you. It usually takes one of these forms:

  • The backend's own OTLP endpoint. Applications and agents send straight to the vendor, and filtering or sampling happens in the vendor's ingest pipeline.
  • A hosted telemetry pipeline. A separate service receives OTLP, applies your processing rules and forwards the data to one or more backends.
  • A provider-run Collector. A cloud provider or vendor runs Collector instances in your account or cluster and handles scaling and upgrades.

What you gain is less to operate: no scaling, upgrades or on-call for the pipeline. What you give up depends on the option. Processing happens after data leaves your network, so redaction has to happen earlier, in the SDK or an agent. Sampling and routing rules are limited to what the service offers. Sending to several backends may not be possible, and moving away can mean rebuilding your rules elsewhere.

Self-hosted vs managed at a glance

Self-hosted gatewayManaged option
Who scales, upgrades and is on callYour teamThe provider
Tail sampling rulesAny rule the Collector supportsWhat the service offers
Redaction before data leaves your networkYesOnly in SDKs or agents
Sending to several backendsYes, any OTLP or supported backendDepends on the service
Buffering when a backend is downYour queues and storageThe provider's
Changing backends laterA configuration changeMay mean moving your rules

How to choose

  • Start without a gateway if you have a handful of services and one backend. Send from the SDKs or a Collector agent, and add a gateway when you need what it does.
  • Self-host if you need tail sampling with your own rules, must redact before data leaves your network, route to more than one backend, or already run Kubernetes services with on-call coverage.
  • Go managed if nobody on the team can own another production service, and your sampling and redaction needs are simple enough for SDKs, agents or the provider's rules.
  • Mix them where it helps: a self-hosted agent tier for redaction and enrichment, sending to a managed endpoint.

Sending gateway data to Atatus

Atatus accepts OTLP traces, metrics and logs over HTTP at https://otel-rx.atatus.com, with your Atatus API key in the api-key header, so a gateway sends to it with the otlphttp exporter. This second-tier configuration keeps every trace with an error, every trace slower than 2 seconds and 10% of the rest, removes the Authorization header attribute, and keeps its queue on disk:

receivers:
  otlp:
    protocols:
      grpc:
        endpoint: 0.0.0.0:4317

processors:
  memory_limiter:
    check_interval: 1s
    limit_percentage: 80
    spike_limit_percentage: 15
  attributes/redact:
    actions:
      - key: http.request.header.authorization
        action: delete
  tail_sampling:
    decision_wait: 10s
    policies:
      - name: keep-errors
        type: status_code
        status_code:
          status_codes: [ERROR]
      - name: keep-slow
        type: latency
        latency:
          threshold_ms: 2000
      - name: sample-the-rest
        type: probabilistic
        probabilistic:
          sampling_percentage: 10

extensions:
  file_storage/queue:
    directory: /var/lib/otelcol/queue  # must exist and be writable

exporters:
  otlphttp/atatus:
    endpoint: https://otel-rx.atatus.com
    headers:
      api-key: ${env:ATATUS_API_KEY}
    sending_queue:
      storage: file_storage/queue
      batch:
        flush_timeout: 200ms
        min_size: 8192

service:
  extensions: [file_storage/queue]
  pipelines:
    traces:
      receivers: [otlp]
      processors: [memory_limiter, attributes/redact, tail_sampling]
      exporters: [otlphttp/atatus]

Get the API key in Atatus under Settings, Account Settings, API Keys, using a key with write permission, and pass it to the Collector as the ATATUS_API_KEY environment variable. Traces, metrics and logs arrive in Atatus joined by trace ID. The OpenTelemetry guide covers instrumenting the services that feed the gateway.

Frequently asked questions

Do I need an OpenTelemetry Collector gateway?

No. SDKs can export straight to a backend, and a Collector agent on each host covers most simple setups. A gateway is worth running when you need tail sampling, central redaction, routing to several backends, or a single path out of your network.

Is the Collector batch processor deprecated?

Yes. The OpenTelemetry project deprecated it on November 11, 2026. Exporter-level batching becomes the default in v0.171.0, planned for February 2027, and the processor is due to be removed in v0.177.0, planned for May 2027. Turn on batching in the exporter's sending_queue instead, or use the new queue_batch processor.

Can I put a normal load balancer in front of a tail sampling gateway?

Not on its own. A load balancer spreads requests, so spans of the same trace land on different Collectors and each one decides on part of the trace. Use a first tier with the load_balancing exporter routing by trace ID, so each trace reaches one sampling Collector.

How do I avoid losing data when the backend is down?

Use the exporter's sending queue with retries, and back it with the file_storage extension so queued data survives a restart. Size the queue for the outage you want to ride out, and alert on the queue size and on enqueue failures.

Atatus is an OpenTelemetry backend for OTLP traces, metrics and logs, whether they come from SDKs, Collector agents or a gateway. See OTLP and the OpenTelemetry Collector for the basics.

← All posts

Get started

See the root cause first.

Start free and send your first trace with OpenTelemetry or the Atatus agents. APM, logs, RUM, infrastructure and SIEM, all on one timeline.

  • SaaS
  • On-premises
  • Hybrid
  • BYOC
  • Unlimited team members
Keep reading