Scale OpenTelemetry Collector deployments using the loadbalancingexporter to route traces from gateway collectors to tail-sampling backends by trace ID

domain: opentelemetry.io · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. In a two-tier Collector architecture, configure the first tier (gateway/load-balancer) to use the loadbalancingexporter from opentelemetry-collector-contrib
  2. Set routing_key: traceID in the loadbalancing exporter config so that all spans sharing a trace ID are consistently forwarded to the same second-tier Collector instance
  3. Configure the resolver to either static (for fixed backend lists), dns (for headless Kubernetes service DNS round-robin), or k8s_service (for Kubernetes service endpoint enumeration) depending on your deployment model
  4. Point the exporter's protocol to otlp with the backend Collector OTLP receiver address; the loadbalancing exporter uses consistent hashing so adding or removing backends only remaps a fraction of traces
  5. Configure the second-tier Collectors with the tailsamplingprocessor; they now receive all spans for each trace they are responsible for, which is required for accurate tail-based sampling decisions
  6. Monitor the otelcol_loadbalancer_backend_latency and otelcol_loadbalancer_num_resolutions metrics on the gateway tier to detect uneven distribution or backend failures

Known gotchas

Related routes

Route traces to tail-sampling backends using the loadbalancing exporter
github.com/open-telemetry/opentelemetry-collector-contrib · 6 steps · unrated
Configure the OpenTelemetry Collector tail sampling processor with multiple composite policies for intelligent trace retention
opentelemetry.io · 6 steps · unrated
Configure the OpenTelemetry Collector groupbytrace processor to buffer and group spans by trace ID before a downstream tail-sampling processor
github.com/open-telemetry/opentelemetry-collector-contrib · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans