Surviving One Million Metrics per Second: Architecture Decisions That Actually Matter
At a million metrics per second, observability becomes a data engineering problem, and the decisions between pipeline stages matter more than the tools you pick.
A staged pipeline architecture for high-volume observability without runaway costs.
Somewhere between "we installed Prometheus" and "our platform emits a million data points every second," observability quietly changes categories. It stops being a tooling choice and becomes a distributed data engineering problem, with all the failure modes that it implies: ingestion collapses under burst traffic, storage bills grow faster than the business, and the dashboards you need during an incident time out precisely because there is an incident.
The teams that get through this transition tend to converge on the same shape of solution: a staged pipeline with an OpenTelemetry Collector fleet at the edge, Apache Kafka as a durable buffer in the middle, a stream processing tier that reshapes data before it becomes expensive, and tiered storage behind something like Thanos. What separates pipelines that hold up from those that don't is rarely tool selection. It is the decisions made at the boundaries between stages. This article walks through those decisions.
Decompose Before You Scale
Treat the pipeline as five independently scalable layers: ingestion, transport, processing, storage, and serving. The flow looks like this:
SDKs/agents → OTel Collectors → Kafka → stream processors → TSDB + object storage → query layer
The reason to insist on this decomposition is that each layer fails and scales on its own terms. Ingestion is CPU- and network-bound and spikes with traffic. Storage is capacity-bound and grows monotonically. Query load follows humans and incidents, not request volume. When these concerns share infrastructure, you end up buying bigger nodes to fix problems that only one layer actually has.
The below Figure 1 shows how the layers connect and what drives scaling at each boundary.

The Collector Is a Policy Enforcement Point, Not a Relay
Running the OpenTelemetry Collector as a DaemonSet gives every workload a node-local place to hand off telemetry, which keeps cross-node traffic down. But its real value is that it is the last cheap place to make decisions. Everything downstream of the Collector costs more per byte.
At this volume, most teams split the Collector into two tiers: a node-local agent DaemonSet that receives and enriches telemetry, and a central gateway Deployment that applies shared policy and is the only tier that talks to Kafka. Exporting straight to Kafka from every node is simpler, but it spreads Kafka credentials and broker connections across the whole fleet, and every policy change means rolling a DaemonSet across every node. The agent/gateway split keeps both in one place.
Processor ordering inside the Collector is one of those details that looks pedantic until a traffic surge proves otherwise:
service:
pipelines:
metrics:
receivers: [otlp, prometheus]
processors: [memory_limiter, filter, k8sattributes, resource, batch]
exporters: [kafka]
Place memory_limiter first so memory pressure is handled before expensive downstream processing and the Collector starts refusing work before the kernel kills it. Filtering comes next, so junk signals are dropped before any further effort is spent on them. Filter rules at this position can only match attributes that already exist when data arrives; a rule that depends on attributes added later needs a second filter processor placed after the processor that adds them. Enrichment follows: k8sattributes attaches Kubernetes identity (namespace, pod, workload), and resource adds cluster, region, and environment, so every record that survives carries stable identity labels. Batching goes last, immediately before export. Get this order wrong, and a surge turns your collection layer into an outage amplifier.
Batching Is Worth More Than New Hardware
If you can make only one tuning change, make it this one. Producing one Kafka message per metric wastes most of your capacity on per-message overhead. Aggressive batching can multiply throughput on the same hardware. The exact gain depends on payload shape, so benchmark it against your own traffic before sizing the cluster around it:
extensions:
file_storage:
directory: /var/lib/otelcol/queue
processors:
batch:
send_batch_size: 8192
send_batch_max_size: 16384
timeout: 5s
exporters:
kafka:
protocol_version: 3.7.0
topic: metrics-raw
encoding: otlp_proto
partition_metrics_by_resource_attributes: true
sending_queue:
enabled: true
storage: file_storage
producer:
compression: zstd
max_message_bytes: 4000000
required_acks: -1
service:
extensions: [file_storage]
Binary encoding plus zstd should be the default for high-volume paths. JSON payloads are pleasant to debug and painful to pay for, on every message, forever.
Message size: max_message_bytes: 4000000 only works if Kafka accepts it. The broker default message size limit is about 1 MB, so raise message.max.bytes on the brokers (or max.message.bytes on the topic) to match, and review consumer fetch sizes. Otherwise, producers will see rejected batches.
Durability: required_acks: -1 waits for all in-sync replicas; pair it with min.insync.replicas=2 on a topic with replication factor 3. Setting it to 1 is faster, but the partition leader acknowledges alone, so a leader failure before followers catch up loses data that the Collector believes was delivered. That undercuts the main reason for putting Kafka in the pipeline.
Kafka Decouples Ingestion From Everything Downstream
The transport layer exists so that a slow consumer, a storage compaction stall, or a bad processor deploy doesn't decide whether telemetry can enter the system. Kafka buys you durable buffering through spikes, replay after a bad deploy or a broken transformation, and the freedom to scale producers and consumers independently.
Two boundary decisions matter here. First, partition count: under-partitioning caps consumer parallelism long before hardware limits appear, and it is far more common in practice than over-partitioning. Size partitions for peak traffic, not the average. Second, the partition key: a stable key derived from service and host identity keeps related series on the same partition, which spares stateful consumers from constant out-of-order handling.
Spend Processing Effort Where Data Is Still Cheap
Once telemetry lands in Kafka, a stream processing tier (Kafka Streams, Flink, or similar) should make it cheaper and safer before long-term storage sees it: schema validation with a dead-letter topic for malformed records, routing by signal type, enrichment, and, most importantly, cardinality enforcement and pre-aggregation.
Cardinality deserves the emphasis because it, not raw volume, produces the ugliest surprises. A single label like user_id or an unbucketed URL path can mint millions of time series overnight, degrading query latency and compaction while the ingest rate looks perfectly normal. Enforce an allow-list of labels at the processing tier, hash or bucket anything granular, apply per-service active-series quotas, and publish drop counters so the shedding is visible rather than silent. Doing this in dashboards after the series exist is too late; the storage cost has already been paid.
Pre-aggregation is the other half of the economics. Gauge-heavy workloads rarely need per-second samples retained forever. Rolling them into one-minute windows before the TSDB write slashes write amplification while preserving what dashboards and alerts actually consume. Keep a raw topic for replay and specialized consumers; feed the hot path from the aggregated one.

Design the Overload Behavior Before the Incident
Telemetry volume explodes at exactly the moment you need telemetry most. Every stage therefore needs a documented answer to "what happens when I can't keep up": scale consumers when lag crosses a warning threshold, shed low-priority signals when saturation becomes serious, and reject new work predictably (so clients back off and retry) when buffers approach exhaustion.
For pipeline health, watch consumer lag rather than throughput. Throughput can look flattering while the system falls steadily behind; lag tells you whether you are keeping up with reality.
Match Storage Cost to Query Patterns
Retaining everything at full resolution is a decision to overpay for data almost nobody queries. A three-tier layout - hot for recent data and fast queries, warm for full-resolution recent history, cold object storage with aggressive downsampling for trends - aligns spend with actual access patterns. Thanos fits naturally here, providing compaction, downsampling, and a single query interface across tiers. When someone insists on months of raw-resolution retention, ask which business question requires it. Usually none does.
A Closing Test
Before calling the pipeline production-ready, check that memory_limiter leads every Collector pipeline, batching and compression are on, Kafka acknowledgments and message size limits are set deliberately on both producers and brokers, topics are split by signal type, partitions reflect peak load, every risky consumer has a dead-letter queue, cardinality limits sit ahead of the TSDB, the TSDB can accept replayed data, retention rules are written down, and alerts cover lag, drops, and compaction health - with runbooks for replay and recovery.
Finally, make sure something outside the pipeline is watching it: a small, independent meta-monitoring setup that alerts when the main pipeline stops delivering data, because a broken pipeline cannot report its own failure.
None of that is glamorous. But the architectures that survive a million metrics per second are the ones designed around burstiness, bad labels, and failure from the start - built so the write path and the read path can grow without holding each other hostage.
Opinions expressed by DZone contributors are their own.