Designing a Telemetry Hub
A design document for the case where telemetry arrives in multiple formats — OpenTelemetry, agent-SDK-native, vendor/legacy — and must reach multiple destinations such as Langfuse, Datadog, Prometheus, The OpenTelemetry Collector stops being a relay and becomes a translation and routing hub.
1. When you need a hub (and when you do not)
Start with the decision, because a hub is a significant commitment.
Direct export — each component sending OTLP straight to one backend — is the correct default. Choose it when producers already speak OTLP and you have a single destination. It is the simplest topology and requires no shared service.
Design a hub when the problem has one or more of these properties:
- Heterogeneous producers. Telemetry arrives in more than one format: OTLP from instrumented services, a framework's native emitter, a legacy Zipkin or Jaeger tracer, Prometheus metrics, or log shippers such as Fluent Bit.
- Multiple destinations. The same telemetry must reach several backends — Langfuse for agent traces, Datadog for APM, Prometheus for metrics, S3 for archival — possibly with different content or policy per destination.
- Egress control / data minimization. Some data must not leave for the observability platform at all. This is broader than PII: internal identifiers, secrets or tokens that leaked into a prompt, auth headers, full request bodies, or proprietary business data. A policy decides what is permitted to leave — and that policy is often stricter for an external SaaS backend than for an in-account store, so masking can differ per destination.
- Standardization. Enforce one schema, naming, and tagging convention across all sources, so everything downstream is queryable the same way regardless of which producer emitted it.
A hub centralizes the work that would otherwise be duplicated across every producer and consumer: format translation, schema standardization, data governance (PII, secrets, egress control), and routing. All of this is configuration against the Collector's built-in processors, not hand-written code. That value is real, and so is the cost: a hub becomes critical shared infrastructure and a schema authority. Build it when the properties above hold. Do not build it to future-proof a single-format, single-backend system.
The hub is an off-the-shelf open-source server, not custom software. The hub in this document is the OpenTelemetry Collector — a finished, open-source server maintained by the OpenTelemetry project, distributed as a binary and as the Docker imageotel/opentelemetry-collector-contrib. You run it and give it a YAML configuration; the receivers, processors (redaction, transform, routing), and exporters are already compiled in. You configure it, you do not write it — the same model as nginx or PostgreSQL. The "functionalities" below are therefore mostly YAML configuration against built-in components; you write actual code only to ingest a format the Collector does not support (a small conversion shim) or to express logic beyond the rule language (a custom processor in Go). Other open-source collectors exist — Grafana Alloy, Vector, Fluent Bit — but the OpenTelemetry Collector is the standard assumed here.
2. The hub architecture

Telemetry flows through six stages. Two of them — normalize and govern — carry the most design risk and are highlighted in the diagram.
3. The functionalities the hub must support
3.1 Multi-format ingest (receivers)
The hub accepts every format a producer emits:
- OTLP (gRPC/HTTP) — the native path for instrumented services.
- Agent-SDK-native — a framework-specific emitter that does not speak OTLP. Handle it with a receiver that understands the format, or a pre-processing shim that converts to OTLP before ingest.
- Vendor and legacy — Zipkin, Jaeger, Prometheus scrape.
- Logs — Fluent Bit / Fluent Forward, or a CloudWatch Logs subscription.
Design decision: define where conversion happens for anything that is not natively OTLP — inside a Collector receiver, or in an external adapter. Every non-OTLP source needs an explicit adapter story.
3.2 Normalize to a canonical model (the core value)
Different sources name and structure the same concepts differently. The hub maps them all onto one schema so downstream everything is queryable consistently:
- Map every source to a single schema — the OTEL Semantic Conventions, plus the GenAI conventions for model/token/tool attributes.
- Reconcile identity: a
trace_idfrom an OTLP source and a correlation id from a native SDK must be unified, or the single-trace guarantee breaks across formats.
This is the hardest stage. A native source that does not emit W3C trace context cannot be stitched into an OTLP trace by wishful mapping; you need a deliberate correlation strategy, or you accept that such sources remain standalone.
3.3 Enrich
Add consistent, derived context in one place: resource tags (environment, team, cost center), and derived fields such as a cost attribute computed from token counts. Central enrichment means every destination sees the same enriched data.
3.4 Govern — redact, mask, drop, and control egress
Governance is broader than PII. It covers everything the hub must mask or withhold before telemetry leaves, enforced once for all sources:
- PII — names, emails, account numbers in prompts and completions, the main sensitive surface in agentic telemetry.
- Secrets and credentials — tokens or auth headers that leaked into a prompt or request body.
- Egress control / data minimization — internal identifiers, full request or response bodies, or proprietary business data that policy says must not reach the observability platform at all.
All of this is done with the built-in
redaction , transform , and filter processors (configuration, not code). Governance is per destination: a policy can mask or drop more for an external SaaS backend than for an in-account archive. That makes it a routing-aware policy applied on each exporter branch, not a single global pass.3.5 Reliability and flow control
-
memory_limiterto protect the hub from overload.
- Queues, retry with backoff, and persistent buffering so a backend outage does not drop data.
- Independent failure per exporter: Datadog being unavailable must not block delivery to Langfuse.
3.6 Route and fan out (the other half)
Routing is more than "send everywhere." The hub sends selectively and transforms per target:
- Fan-out — all traces to Langfuse and Datadog and an S3 archive.
- Conditional routing — dev traffic to Langfuse, prod to Datadog; GenAI spans to Langfuse, infrastructure spans to Datadog; errors to a high-retention store; everything to a low-cost archive.
- Per-target transformation — each exporter has its own format and auth (Datadog exporter, OTLP+auth for Langfuse, a file format for S3) and its own redaction level.
In OpenTelemetry this is expressed with the
routing connector and multiple per-signal pipelines.4. Design considerations
Beyond the standard operational concerns — security, availability, backpressure, scaling, and cost — heterogeneity and multi-target routing introduce these:
- Schema ownership and drift. Decide who owns the canonical schema and what happens when a new source appears with unmapped fields. Define a default (pass through unknown attributes) and maintain a mapping registry.
- Cross-format identity and correlation. The hardest problem. Establish how a non-OTEL source participates in a trace — a shared correlation id, or an accepted limitation that it stays standalone.
- Per-exporter policy. Different governance (what is masked or dropped), sampling, and format per destination — typically stricter for an external SaaS than for an in-account store. Routing is "transform and gate per destination," not "copy to N places."
- Stage ordering. Normalize before routing, so routing rules see consistent fields. Redact before any external exporter, and potentially differently per exporter.
- Lossy-ness per target. Some backends cannot represent everything a source emits. The hub decides, explicitly, what degrades where.
- Shared-infrastructure discipline. A hub is a single dependency for many producers and consumers, and a schema authority. It needs change management, versioning, and its own observability (self-telemetry).
5. Deployment and placement
The functional design above is independent of where the hub runs. Placement is a separate decision, driven by how producers reach the hub. For serverless and managed producers (Lambda, AgentCore Runtime) that run outside your VPC and are egress-only, the placement design is covered separately.

The load-bearing decision is reachability without public ingress: the hub runs as a private, authenticated endpoint (private DNS or internal load balancer, mTLS or token auth, security group scoped to known sources), and producers egress to it. A central gateway (for example on ECS Fargate, with no public IP) is the typical shape; lightweight Collector sidecars or Lambda extensions can sit in front of it for local batching, with only the gateway holding the routing and governance policy.
6. Building (assembling) the hub
"Building" the hub rarely means writing software. It means assembling a deployment of the open-source OpenTelemetry Collector. The work falls into four layers.
The artifact. Choose a distribution:
- The
otel/opentelemetry-collector-contribimage bundles every component. It is convenient for prototyping but large.
- For production, build a trimmed binary with the OpenTelemetry Collector Builder (
ocb), including only the receivers, processors, and exporters you use. This yields a smaller image and attack surface. Pin the version — OTTL and routing syntax change between releases.
The configuration. The YAML that declares receivers, processors, exporters, and per-signal pipelines (Sections 3 and 8). This is where the hub's behavior lives.
The runtime. Where it runs (ECS Fargate, EKS, or EC2), the replica count, CPU and memory sizing, and the private, authenticated endpoint producers reach (Section 5).
The operational wrapper. Health checks, autoscaling, rollout/rollback, secret delivery for backend API keys, and — critically — the hub's own telemetry. A hub that cannot report that it is dropping data is worse than no hub. Export the Collector's internal metrics (queue depth, refused/dropped spans, exporter failures) to a backend you watch.
You write actual code in only two cases, both covered earlier: a conversion shim for a format the Collector does not support, or a custom processor in Go (built with
ocb ) for logic beyond the rule language.7. Resilience
The hub sits in the path of your telemetry, so its central design question is: when something fails, do you lose telemetry, block the application, or degrade gracefully? Reason about it along five failure axes.

1. The hub itself fails. A single gateway is a single point of failure. Run multiple replicas behind the internal endpoint. One subtlety constrains this: tail-based sampling is stateful — all spans of a trace must reach the same replica — so you need trace-id-aware routing, or a dedicated sampling tier. The two-tier pattern mitigates the single point of failure: a lightweight agent or sidecar next to each producer buffers locally and forwards to the central gateway, so a gateway blip causes buffering, not loss.
2. A backend fails. Exporters need retry with backoff and a sending queue so a backend outage does not immediately drop data. Queues are finite: when full, prefer dropping telemetry over applying backpressure to the application. Give each exporter its own queue so Datadog being down does not block Langfuse. For durability across restarts, use a persistent, file-backed queue.
3. The hub is overwhelmed. Place
memory_limiter first so the Collector sheds load before it runs out of memory. A Collector that OOM-loops drops everything; controlled shedding drops only some. Autoscale on CPU, memory, or queue depth.4. The producer cannot reach the hub. This is why the agent/sidecar tier matters: the producer exports to
localhost , which is always available, and the local agent owns the retry and buffer to the gateway. Without it, a gateway outage turns into inline export failures or added latency in the producer — which, in a serverless runtime, can mean lost spans.5. Bad or poison input. A malformed span or a failed transform must not halt the pipeline. Processors should fail open (pass the span through) or fail safe (drop only that span), never stop the Collector.
The guiding principle
Telemetry is best-effort; the application is not. The hub must never make the application slower or less available than it would be without the hub. That single principle resolves most choices: prefer buffered export over synchronous blocking, prefer dropping telemetry over backpressure on the application, keep the buffer close to the producer, and run the gateway replicated and horizontally scalable within the stateful-sampling constraint.
The resilience you invest in is proportional to how much you depend on the telemetry. For debugging dashboards, best-effort with simple retries is sufficient. When telemetry feeds billing, paging alerts, or compliance and audit, persistent queues, replication, and a "never silently drop" guarantee become requirements, and you operate the hub as a production data pipeline.
8. Processor order (reference)
The order of processing inside the hub is itself a design decision:
receivers (multi-format) → memory_limiter # protect the hub first → normalize # map to canonical schema; reconcile identity → enrich # tags, derived fields → govern # redact PII/secrets, mask, drop (egress control; routing-aware) → tail_sampling # keep errors + slow, sample the rest (gateway only) → batch # efficient export, last → routing → exporters # fan out + per-target transformProtect first, normalize before anything reads attributes, govern before any external exporter, batch last.
9. Summary
- A hub is warranted by heterogeneous producers, multiple destinations, egress-control/data-minimization needs, or standardization across sources — not by a single-format, single-backend system, where direct export is simpler and sufficient.
- Its six functions are: multi-format ingest, normalize, enrich, govern, ensure reliability, and route/fan-out.
- Normalize (one canonical schema + identity reconciliation) and govern (central, routing-aware redaction/masking/egress control — PII, secrets, and any data not permitted to leave) carry the most design risk. Both are configuration against built-in processors, not code.
- Routing is selective and per-target, not a broadcast.
- Placement is a separate decision; for serverless/managed producers the constraint is private, authenticated reachability without public ingress.
- Building the hub means assembling the open-source Collector (a trimmed
ocbbuild, a config, a runtime, and an operational wrapper with its own telemetry) — not writing software, except for a conversion shim or a custom Go processor.
- Resilience follows one principle: telemetry is best-effort; the application is not. Buffer near the producer (agent tier), replicate the gateway, shed load with
memory_limiter, queue and retry per exporter, and drop telemetry rather than apply backpressure to the application. Invest in proportion to how much you depend on the telemetry.
- A hub is critical shared infrastructure: treat it as a schema authority with change management and its own observability.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article