Collector High Availability Design in OpenTelemetry
A complete, plain-English guide to keeping your telemetry pipeline alive when processes crash, nodes disappear, backends stall and traffic spikes, using redundancy, buffering, smart routing and careful monitoring of the Collector itself.
Imagine a city with one single post office. Every letter from every neighbourhood must pass through its front door. On a normal day, it works fine. Then one morning a pipe bursts, the building closes, and for hours nobody can send or receive anything. The letters pile up in mailboxes, some get lost, and nobody can even find out which ones. The city did not lack letters or trucks; it lacked a plan for what happens when the one building everybody depends on stops working.
The OpenTelemetry Collector sits in exactly that position in many systems. Applications send their traces, metrics and logs to it, and it forwards them to the places where engineers look at them. If the Collector goes down at the wrong moment, you lose the very data you would need to understand the outage. High availability design is the discipline of building that middle layer so that a single failure, or even several, never turns into lost visibility. In this tutorial we will build the idea slowly, one concept at a time, so you can design, review and operate a resilient Collector setup with confidence.
1Why the Collector Must Not Be a Single Point of Failure
Before we design anything, we need to understand what the Collector does, and why its failure hurts more than most people expect.
The OpenTelemetry Collector is a standalone program that receives telemetry from applications, optionally processes it, and sends it onward to one or more destinations. Think of it as a sorting centre for observability data. It can accept data in many formats, add or remove information, group small messages into larger batches, drop things you do not want, and deliver the result to the storage or analysis system of your choice.
Because it sits between your applications and your backend, the Collector protects the applications from the backend’s moods. Applications hand data to a nearby, fast, friendly receiver and move on with their work. The Collector then takes on the hard job of delivering that data reliably over a network to a distant system that may be slow or temporarily unavailable. This is a very valuable service, but it also makes the Collector a point of concentration. Whatever the Collector loses, nobody else has a copy of.
Think of a hospital emergency generator. Nobody notices it on a normal day. During a power cut it is the only thing keeping the lights on in the operating room. Observability tools are most valuable during incidents, and incidents are exactly when parts of your system are most likely to fail, including your Collector. So the Collector must be built like the generator: boring, redundant and tested.
What high availability means here
High availability simply means that the service keeps working when parts of it fail. For a Collector tier, that has two practical parts. First, the tier should keep accepting data when one instance dies, so applications never see long errors or stalls. Second, the tier should keep delivering data when the backend or the network misbehaves, so short outages become delays instead of permanent losses.
Perfect availability is not the goal; a known, tested level of protection is. Every extra safeguard costs money, memory, disk or complexity, so the design question is always: how much data loss or delay can this system tolerate, and what is the cheapest design that stays inside that limit?
2The Vocabulary You Need First
Each term below comes with what it is, why it exists, and a picture to hold in your head.
Receiver
The Collector’s front door. It accepts incoming telemetry, for example from applications sending over the standard OpenTelemetry protocol. Like a reception desk.
Processor
A step that changes data in flight: batching, filtering, adding labels, protecting memory. Like a sorting belt in a warehouse.
Exporter
The Collector’s back door. It sends data onward to a backend or to another Collector, and is where retries and queues live.
Pipeline
One complete path of receivers, processors and exporters for one kind of signal. A Collector can run several pipelines side by side.
Agent
A Collector placed close to the applications, often one per machine. It collects locally and forwards to the next tier.
Gateway
A shared Collector tier that receives data from many sources through one endpoint, then processes and routes it onward.
Replica
One running copy of a Collector. Several replicas doing the same job give you spare capacity and protection against a single crash.
Load balancer
A traffic director that spreads requests across replicas and stops sending to those that are unhealthy.
Sending queue
A waiting line inside an exporter that holds data while the destination is slow or unreachable.
Backpressure
The signal a full or overloaded component sends backwards to tell senders to slow down or retry later.
Failover
Moving work to a healthy copy when a component fails, ideally automatically and quickly.
Stateful component
A processor that must remember things between messages, such as which spans belong to which trace. It cannot be scaled by simple copying.
Collector is the name of the program, and agent and gateway are roles that the same program plays. There is no separate agent program and gateway program; it is one binary with different configuration and placement.
3What Can Actually Go Wrong
You cannot design against failures you have not listed, so let us walk through the realistic ones.
Failures in a Collector tier fall into a few families. Some are about the machine, some are about the network, some are about overload, and some are about people. Naming them makes later design choices feel less like magic and more like answers to specific questions.
| Failure | What it looks like | What protects you |
|---|---|---|
| Process crash | The Collector exits suddenly, perhaps out of memory | Several replicas, automatic restart, memory protection |
| Node or machine loss | Everything on one host disappears | Replicas spread across hosts, persistent queues on durable disks |
| Zone or data centre outage | A whole failure domain goes dark | Replicas spread across zones, regional gateways |
| Traffic spike | Data arrives faster than it can be processed | Memory limits, headroom, autoscaling, backpressure |
| Backend outage or slowness | The destination refuses or delays data | Retries, sending queues, disk buffers, message queues |
| Network partition | Tiers cannot reach each other | Buffers at each tier boundary, reconnect logic |
| Bad configuration | A change breaks the pipeline or crashes replicas together | Validation, staged rollout, quick rollback |
| Rolling restart | Replicas restart one by one and briefly drop connections | Graceful shutdown, readiness checks, spare capacity |
Think of a motorway during a holiday weekend. Cars can be stopped by a breakdown on the road (crash), a closed lane (partial outage), a flood of traffic (spike), a closed tunnel (backend outage), or a signpost change that sends everyone the wrong way (bad configuration). Engineers add spare lanes, rest stops, diversion routes and signs that are tested before they go live. Each safeguard answers a different kind of problem.
In practice, a surprising share of telemetry outages come from changes made by people, such as a configuration rollout that breaks every replica at the same time. Redundancy does not help if all copies share the same mistake, so safe change management is part of high availability, not a separate topic.
4The Core Idea in One Page
High availability for the Collector rests on five simple habits, repeated at every layer.
Never rely on one copy
Run several replicas of every Collector tier, spread across failure domains, so losing one changes little.
Protect memory first
A Collector that runs out of memory dies and takes its in-flight data with it. Limit memory deliberately and refuse new data politely before reaching the cliff.
Buffer at the boundaries
Wherever data crosses to something that can fail, such as the network or a backend, put a queue so that short failures become short delays.
Route stateful work deliberately
Components that must see all related data together need a smart routing layer in front of them, not a plain load balancer.
Watch the watchers
Monitor the Collector itself, with queue depth, refusals and failures, so you notice trouble before data disappears.
Notice that none of these habits is about making any single Collector unbreakable. Individual programs crash, disks fill and networks wobble. High availability is the art of making sure those ordinary events stay ordinary, never growing into outages of your visibility. The rest of this tutorial turns each habit into concrete design choices.
5Deployment Patterns and What They Mean for Availability
Where you place Collectors decides which failures you can survive, so the pattern comes before the settings.
OpenTelemetry describes a handful of deployment patterns. They are not rivals; many real systems combine them. What matters for this tutorial is how each pattern changes the failure picture.
No Collector
Applications send data directly to the backend. It is the simplest option, with nothing extra to run, but every application must handle retries, buffering and backend outages on its own, and a slow backend can directly affect application behaviour.
Agent pattern
A Collector runs close to the applications, often one per host or as a companion to each workload. Failures are local, since one agent serves a small group of applications, but each agent needs a path onward, and you now have many small Collectors to manage.
Gateway pattern
A shared tier of Collectors receives data from many sources through one address, then processes and forwards it. This centralises configuration, credentials and heavy processing, but it becomes a concentration point that must itself be made highly available.
Agent plus gateway
Agents near the applications forward to a gateway tier, which forwards to the backend. This is the most common design for larger systems, and it gives you resilience boundaries at each hop.
flowchart LR
subgraph HOSTS["Application hosts"]
A1["App A"] --> AG1["Agent collector"]
A2["App B"] --> AG1
A3["App C"] --> AG2["Agent collector"]
end
AG1 --> LB["Load balancer"]
AG2 --> LB
subgraph GW["Gateway tier: several replicas"]
G1["Gateway 1"]
G2["Gateway 2"]
G3["Gateway 3"]
end
LB --> G1
LB --> G2
LB --> G3
G1 --> BE["Observability backend"]
G2 --> BE
G3 --> BE
The path from an application to a nearby agent is short and usually stays on one machine, so it rarely fails. The longer hops, from agent to gateway and from gateway to backend, cross networks and shared systems. That is where queues, retries and redundancy deliver the most value.
6Making the Agent Tier Resilient
Agents are many and small, so their availability comes from simplicity and from a good path onward.
An agent usually runs one per machine, or as a sidecar next to a workload. Its job is intentionally light: receive local telemetry, add useful context such as the machine and cluster names, protect itself from overload, and forward the result onward. Because each agent serves only the applications on its own host, an agent failure affects only that host, which already limits the blast radius.
Keep the agent boring
The more work an agent does, the more ways it can fail and the more memory it needs. A reliable agent tier keeps processing minimal. Heavy tasks, such as sampling decisions that need whole traces or large aggregations, belong to the gateway tier where resources are shared and managed centrally.
Make restarts cheap
Agents get restarted for upgrades, configuration changes and node maintenance. If an agent holds large amounts of in-flight data in memory, every restart loses it. Keeping queues small and forwarding quickly makes a restart almost invisible. Where the agent runs on infrastructure that restarts often, applications’ own tracing libraries should also have sensible retry settings, so a few seconds of unavailability does not turn into lost spans.
An agent is like a neighbourhood mailbox. It does not sort letters or keep them for long; it simply collects and hands them to the truck. The more you ask a mailbox to do, such as storing parcels for weeks, the more likely it is to break or overflow. Keep it simple and let the sorting centre do the heavy work.
Strengths of the agent tier
- Failures stay local to one host or workload.
- Applications talk to a nearby, fast endpoint.
- Host-level context is easy to add.
- Applications are shielded from backend hiccups for short periods.
Limits of the agent tier
- Many small instances are harder to manage consistently.
- Memory used per host competes with the applications themselves.
- Whole-trace or whole-system decisions are not possible locally.
- A crash loses whatever was in memory unless buffered to disk.
7Making the Gateway Tier Resilient
The gateway is the busiest and most important tier, so it gets the strongest redundancy.
A gateway tier is a group of identical Collector replicas sitting behind one address. Because they are identical and hold no memory of earlier requests, any replica can handle any incoming batch, and if one disappears the others simply pick up its share. This is called a stateless design, and it is the easiest kind of design to make highly available.
How many replicas
The OpenTelemetry scaling guidance recommends keeping at least three replicas for resilience. The reasoning is simple arithmetic. With two replicas, losing one halves your capacity at the exact moment your remaining replica must absorb double the traffic. With three, losing one leaves two replicas sharing the load with a much smaller jump per survivor. Three is therefore a sensible minimum, and many teams add more to leave headroom for deployments and maintenance.
| Replicas | Load per replica if all are healthy | Load per replica after one failure | Increase on survivors |
|---|---|---|---|
| 2 | 50% | 100% | 2x, very risky |
| 3 | 33% | 50% | 1.5x |
| 4 | 25% | 33% | 1.33x |
| 6 | 17% | 20% | 1.2x |
Imagine a team of bakers sharing an order list. With two bakers, if one falls ill, the other must double their work and quickly burns out. With six bakers, the loss of one barely changes anyone’s day. Spare capacity is what makes failure boring.
Size the tier so that the remaining replicas can handle full peak traffic with one replica missing, and ideally with one replica missing while another is restarting for an upgrade. That is the practical meaning of the common N plus one, and sometimes N plus two, design.
8Load Balancing Telemetry Traffic the Right Way
Several replicas are only useful if traffic actually reaches all of them, and telemetry traffic has a few quirks.
Applications and agents usually send telemetry over long-lived connections that carry many requests. A basic network-level load balancer, which spreads connections rather than requests, can therefore leave one replica overloaded while another sits idle, because each long connection sticks to the replica it first reached. The scaling guidance recommends load balancers that understand the application-level protocol, so they can spread individual requests across replicas.
Request-aware load balancer
A proxy or cloud balancer that understands the protocol and spreads each request. This gives the smoothest distribution and quick removal of unhealthy replicas.
Service mesh
In Kubernetes environments, a service mesh can spread requests between replicas and add encryption and retries without changing the Collector itself.
Client-side balancing
The sender knows the list of replicas and spreads its own requests. This removes a hop, but the list of replicas must be kept up to date.
Connection recycling
Where only a connection-level balancer is available, limiting how long a connection may live forces senders to reconnect periodically, which gradually re-spreads load.
flowchart TD
S["Many senders with long-lived connections"] --> Q{"Balancer type"}
Q -->|"Connection level only"| U["Uneven load: some replicas busy, some idle"]
Q -->|"Request aware"| E["Even load: each request goes to a healthy replica"]
U --> F["Fix: recycle connections or switch balancer"]
Adding replicas and seeing no improvement because new replicas receive almost no traffic. Check how load is spread across replicas before concluding that you need still more of them.
Health checks decide who gets traffic
A balancer should send traffic only to replicas that are ready. The Collector provides a health check extension that exposes a simple endpoint for this purpose. Orchestration systems and balancers can poll that endpoint to decide whether a replica should receive traffic or be restarted. A replica that is alive but overloaded or still starting should be marked not ready, so it is spared until it recovers.
9Protecting a Single Collector From Itself
Before spreading work over many replicas, make each replica hard to kill with its own memory and its own pace.
The most common cause of a Collector crash is simply running out of memory during a spike. When a process exceeds the memory it is allowed to use, the operating system or the orchestrator ends it abruptly, and everything held in memory at that moment is lost. Worse, when one replica dies, its share of traffic moves to the others, which can push them over their limits too. This chain reaction is how a small spike turns into a full outage.
The memory limiter
The Collector offers a memory limiter processor to prevent this. It watches memory use and, when usage approaches a configured limit, starts refusing new incoming data and asks the runtime to release memory, instead of continuing until the process is killed. Refusing data sounds bad, but it is far better than crashing: the senders are told to retry later, and the data already accepted is preserved. The documented recommendation is to place this processor first in every pipeline, so that it can protect everything that follows.
Think of a restaurant that stops seating new guests when the kitchen is overwhelmed. Guests wait outside, a little annoyed, but every meal that is cooked gets served. A restaurant that keeps seating everybody ends up with a burnt kitchen and no meals at all.
Batching for efficiency
The batch processor groups many small items into larger bundles before they are sent onward. Sending a thousand small requests is far more expensive than sending a few large ones, so batching lowers processor use and network overhead, which also helps resilience because an efficient Collector has more spare capacity. The usual order is memory limiter first, then other processing, then batching near the end.
Receiver accepts data
Incoming requests land at the front door of the pipeline.
Memory limiter checks pressure
If memory is near the limit, new data is refused and senders are told to retry.
Other processors do their work
Filtering, labelling and similar steps run on the accepted data.
Batch processor bundles data
Small items become larger bundles that are cheaper to send.
Exporter queues and sends
The exporter holds data in its queue and delivers it, retrying on failure.
The Collector counts the spans, metric points and log records that the memory limiter refuses. A sustained non-zero count means the tier is at its capacity limit and needs more resources or more replicas.
10Sending Queues and Retries
The exporter is where short outages are turned into short delays, as long as the waiting line is sized with care.
When an exporter cannot deliver data, for example because the backend is restarting, it does not have to give up right away. Exporters can hold data in a sending queue and retry delivery with exponential backoff, which means waiting a little longer between each attempt so the struggling destination is not hammered. By default the retry effort continues for about five minutes before the data is given up on.
Two limits define how much protection a queue gives. The first is time: once the retry window passes, the data it covers is dropped. The second is size: once the queue is full, new incoming data is discarded because there is nowhere to put it. A queue therefore protects against outages that are shorter than both limits, and understanding these two numbers is the heart of capacity planning for resilience.
Think of a bathtub filling while the drain is blocked. The tub holds only so much water, and the tap keeps running. If the plumber arrives before the tub overflows, nothing is lost. If the blockage lasts longer than the tub’s capacity allows, water spills onto the floor. The size of the tub is the queue size, and the speed of the tap is your incoming data rate.
sequenceDiagram
participant P as Pipeline
participant Q as Sending queue
participant X as Exporter
participant B as Backend
P->>Q: Hand over a batch
Q->>X: Next batch
X->>B: Send attempt 1
B--xX: Unavailable
X->>X: Wait, then retry with longer delay
X->>B: Send attempt 2
B-->>X: Accepted
X->>Q: Done, remove batch
When the queue cannot save you
Outage longer than the retry window
When the backend stays down past the retry period, the data covered by that attempt is dropped.
Queue full
When data arrives faster than the queue can hold during an outage, new data is refused or dropped.
Collector restarts
A purely in-memory queue disappears when the process stops, taking its contents with it.
Permanent errors
Data the backend permanently rejects, for example because it is malformed, will not succeed no matter how many retries happen.
Enabling an enormous queue to be safe. A very large in-memory queue simply moves the crash from the backend outage to the Collector running out of memory. Queue size, memory limits and replica resources must be chosen together.
11Persistent Queues: Surviving a Crash
An in-memory queue vanishes when the process dies; a persistent queue writes to disk so work survives.
The Collector can store its queued data on disk using a storage extension. This acts like a write-ahead log: data is written to disk as it is queued, and when the Collector restarts it picks up where it left off instead of starting empty. The resiliency guidance suggests this approach for critical components such as gateways, where the loss of queued data after a crash would be expensive.
An in-memory queue is like a cashier who remembers orders in their head. If the cashier faints, every pending order is forgotten. A persistent queue is like a cashier who writes each order on a ticket and clips it to a rail. If the cashier is replaced mid-shift, the new cashier simply reads the tickets and carries on.
Advantages
- Queued data survives process crashes and restarts.
- Queues can be larger than memory would allow, since disk is cheaper.
- Rolling upgrades stop losing in-flight data.
- Longer backend outages can be absorbed.
Disadvantages and trade-offs
- Disk speed becomes part of the throughput limit.
- Disks can fill up, which needs its own alerting.
- The storage must itself survive: a disk that dies with the machine loses the data.
- More moving parts to size, back up and monitor.
The disk must outlive the process, and ideally the machine
A persistent queue only helps if the storage survives the failure you are guarding against. A disk that is local to a machine protects against process crashes but not against losing the whole machine. In container platforms, this means attaching durable volumes to the Collector, and using workload types that keep each replica bound to its own volume across restarts. Where losing a machine must not mean losing data, the volume should be network-attached or replicated.
Persistent queues give the greatest return at the gateway, where large amounts of data are in flight, and at any tier whose restart would otherwise lose a lot of buffered data. They are usually unnecessary at tiny agents where little is held at any moment.
12Message Queues Between Tiers
When a hop must tolerate long outages, put a durable middleman in the middle.
For the strongest protection, a durable message queue such as Kafka can sit between Collector tiers. Agents act as producers that publish telemetry to named topics, and gateway Collectors act as consumers that read from those topics at their own pace. Because the message queue stores data durably and independently, either side can fail or be restarted without immediately affecting the other.
flowchart LR
AG["Agent collectors: producers"] --> K["Durable message queue: topics"]
K --> G1["Gateway consumer 1"]
K --> G2["Gateway consumer 2"]
K --> G3["Gateway consumer 3"]
G1 --> BE["Backend"]
G2 --> BE
G3 --> BE
When it is worth it
Choose a message queue when outages of the next tier might last longer than memory or local disk can cover, when traffic is extremely bursty, or when several consumers need the same stream. It also lets the gateway tier scale and recover at its own pace.
When it is probably too much
For small and medium systems, the extra service to operate, secure and pay for often outweighs the benefit. Persistent queues and replicated gateways usually give enough protection at much lower complexity.
A message queue moves risk instead of removing it. Now the message queue itself needs replication, capacity planning, retention limits and monitoring. If it fails, you have simply relocated the single point of failure.
13Stateful Components: Tail Sampling and Span Metrics
Plain copying works for stateless tiers but breaks when a component needs to see all related data together.
Some Collector features must remember things between messages. The clearest example is tail sampling, which waits until it has seen enough of a trace to decide whether to keep it, for example keeping traces that contain errors. To decide, one processor instance must receive all the spans of a given trace. If the spans of one trace are spread across several replicas, none of them sees the whole story, and the decision is made on fragments. Span-to-metrics processing has a similar need: all data for the same service must reach the same place to produce accurate totals.
This means that a stateful tier cannot sit behind an ordinary balancer that spreads requests randomly. The scaling guidance describes the solution: put a first tier of stateless Collectors in front, equipped with a load-balancing exporter that picks the destination replica based on the trace identifier or the service name. All spans of one trace then travel to the same backend replica, which holds the complete trace.
Picture a jigsaw puzzle assembled by several teams. If pieces of the same puzzle are handed to different teams at random, nobody can finish it. If every piece with the same picture number goes to the same team, each team can complete its own puzzles. The routing rule by trace identifier is the picture number.
flowchart LR
APP["Agents and applications"] --> LB1["Tier 1: stateless collectors with trace-aware routing"]
LB1 -->|"Trace A"| T1["Tier 2: tail sampler 1"]
LB1 -->|"Trace B"| T2["Tier 2: tail sampler 2"]
LB1 -->|"Trace C"| T3["Tier 2: tail sampler 3"]
T1 --> BE["Backend"]
T2 --> BE
T3 --> BE
Stateful replicas hold partial traces in memory while waiting to decide. If one of them crashes, those in-progress traces are lost. High availability for this tier means giving each replica enough memory, spreading load across several replicas so each holds less, and accepting that a crash costs a small, bounded slice of in-flight traces.
14The Load-Balancing Exporter in Detail
This small component is the glue of the two-tier design, so it is worth understanding how it chooses and what happens when the group changes.
The load-balancing exporter takes each item of telemetry, looks at a routing key, and sends the item to the backend Collector responsible for that key. Common routing keys are the trace identifier, which keeps whole traces together, and the service name, which keeps all data from one service together for span-to-metrics work. The exporter needs to know which backend Collectors exist, and it can learn that from a fixed list, from DNS records, or from a container platform’s service discovery.
Trace identifier
Sends every span of one trace to the same replica. Needed for tail sampling.
Service name
Sends all data of one service to the same replica. Useful for span-to-metrics aggregation.
Static list
Simple and predictable, but the list must be edited whenever replicas change.
DNS or platform discovery
The exporter learns about replicas automatically. In Kubernetes, a headless service lists the individual replicas, which is what the scaling guidance recommends.
What happens when the group changes
When a replica joins or leaves, the mapping from keys to replicas changes for some keys. Traces that were in progress on one replica may suddenly see new spans arrive at a different one, so a small number of traces can be split during the change. This is unavoidable with any routing scheme, and the practical response is to keep membership changes rare and gradual. Rolling restarts one replica at a time, with a pause between them, limit the number of affected traces compared with restarting everything at once.
Treat scaling events of the stateful tier as planned operations. Scale on a schedule when you can, avoid constant autoscaling flapping, and expect a short bump in incomplete traces whenever membership changes.
15Pull-Based Receivers and Duplicates
Not all data is pushed to the Collector; some of it is fetched, and fetched data brings its own availability puzzle.
Applications push their traces and metrics to a Collector, so adding replicas behind a balancer works naturally. But some receivers pull data, for example by scraping the metrics endpoints of many services at regular intervals. If you simply run three replicas with the same scraping job, each replica scrapes every target, and you receive the same metrics three times. Duplicates inflate totals and confuse dashboards.
The answer is to divide the targets between replicas so that each target is scraped by exactly one. The OpenTelemetry Operator offers a Target Allocator, which distributes the scrape targets across Collector replicas automatically and redistributes them when replicas change. This is also how pull-based scraping scales: when a single replica takes too long to finish one scrape cycle, the targets are split across more replicas.
Think of three meter readers who must visit a thousand houses. If all three visit every house, you get three readings per house and a very confusing ledger. If a supervisor gives each reader a third of the streets, every house is read exactly once, and if one reader falls ill the supervisor reassigns those streets.
Singleton sources
Some receivers collect cluster-wide information, such as events from an orchestrator. Running several copies of them produces duplicates. These are usually run as a single replica with a fast automatic restart, or with leader election so that only one copy works at a time while others wait as standbys.
Log file readers
Agents that read log files from the local host are naturally one per host. Their resilience question is about remembering how far they have read, so that a restart does not re-send or skip lines. That progress record should live on storage that survives restarts.
Scaling a scraping tier by simply increasing replicas without sharding targets. The result is multiplied data, not extra capacity, and a bill that grows with every added replica.
16Delivery Guarantees: What No Data Loss Really Means
It is worth being honest about what retries and queues can and cannot promise.
With retries, a sender that does not receive a clear acknowledgement tries again. That protects against loss, but it creates a different risk: the first attempt might actually have succeeded, with only the acknowledgement lost on the way back, so the retry delivers the same data twice. Systems built this way are called at-least-once: every item arrives one or more times, never silently zero times, but sometimes duplicates appear.
| Guarantee | Meaning | Typical cost |
|---|---|---|
| At most once | Never duplicated, but sometimes lost | Simple, fastest, weakest protection |
| At least once | Never silently lost, sometimes duplicated | Retries, queues, some duplicate handling downstream |
| Exactly once | Neither lost nor duplicated | Complex coordination, rarely practical in telemetry pipelines |
Telemetry pipelines in practice aim for at-least-once delivery with small, tolerable duplicate rates. Traces and logs usually tolerate an occasional duplicate better than a gap. Metrics need more care, since a duplicated counter increment would distort totals, which is another reason to avoid running several copies of the same scraper. Backends often handle duplicates by recognising identical identifiers or timestamps.
Some delivery protocols can report that part of a batch was accepted and part was rejected. Retrying the whole batch would duplicate the accepted portion, so good senders retry only what the receiver said failed and drop what it said can never succeed.
The honest design statement is therefore not that no data is ever lost. It is something like: for backend outages shorter than a stated window and for single replica failures, no data is lost, and for anything beyond that, loss is bounded, measured and alerted on. That is a promise you can actually keep and test.
17Capacity Planning and Autoscaling
High availability fails quietly when capacity runs out, so decide up front how you will know it is time to grow.
The scaling guidance names a few signals to watch. Memory pressure, shown by the memory limiter refusing data, says the tier has reached its limits. Export queue build-up, measured as queue size relative to queue capacity, says the Collector cannot deliver as fast as data arrives; the guidance suggests scaling up when the queue is around sixty to seventy percent full, and scaling down when it stays low for a long time. For scraping receivers, the signal is a scrape cycle that takes almost as long as the scrape interval.
When more replicas will not help
Adding Collectors does not fix a problem that lives downstream. If the persistent queue stays saturated even after adding capacity, or if the count of failed sends keeps rising, the real bottleneck is probably the backend or the network between you and it. More Collectors would only move the pile-up from one place to another, and might even make the backend’s situation worse.
Is the Collector refusing data?
If yes, it is short of memory or processing, and more replicas or bigger replicas will help.
Is the export queue filling?
Check whether sends are failing. If failures are rising, look at the backend and the network first.
Is load spread evenly?
If one replica is hot and others idle, fix balancing before adding more.
Only then add capacity
Scale out the tier that is the true bottleneck, and keep spare capacity for failures and upgrades.
Automatic scaling is helpful for stateless tiers but risky for stateful ones, because every change in the group reshuffles routing and splits some traces. For stateful tiers, prefer planned, gradual scaling over rapid automatic changes.
18Container Platform Patterns for Resilient Collectors
Most Collector fleets run on a container platform, which offers several building blocks that map neatly onto the ideas in this tutorial.
Container platforms such as Kubernetes offer different ways to run workloads, and each suits a different Collector role. Choosing the right one removes a lot of manual work from your availability story.
| Workload type | What it does | Best used for |
|---|---|---|
| Daemon-style (one per node) | Runs exactly one copy on every machine | Agents collecting local logs, host metrics and local application telemetry |
| Sidecar (one per workload) | Runs next to each application instance | Strong isolation or special per-workload settings |
| Deployment (stateless replicas) | Runs a chosen number of interchangeable copies | Gateway tiers without disks of their own |
| StatefulSet (stable identity and disk) | Gives each copy a stable name and its own volume | Gateways with persistent queues, and stateful processing tiers |
The availability toolkit of a container platform
Spread rules
Anti-affinity and topology spread rules keep replicas on different machines and in different zones, so one hardware or zone failure cannot take them all.
Disruption budgets
A disruption budget limits how many replicas can be taken down voluntarily at once, protecting you during node maintenance.
Readiness and liveness checks
Readiness decides who receives traffic; liveness decides who is restarted. The Collector’s health check extension feeds both.
Resource requests and limits
Requests reserve capacity and limits cap usage, keeping a noisy Collector from starving its neighbours or being evicted unexpectedly.
Graceful shutdown
A grace period lets a stopping replica finish its queue and stop accepting new data cleanly instead of being cut off.
Rolling update controls
Settings that limit how many replicas change at once keep enough capacity serving during upgrades.
The OpenTelemetry Operator and the community packaging for container platforms can create many of these pieces for you, from the Collector workloads to the target allocator. Using them reduces hand-written configuration, which in turn reduces the chance of mistakes.
A container platform is like a staffing agency for your Collectors. You describe how many workers you need, where they should sit, and how to tell if one is sick. The agency replaces anyone who fails, keeps them on different floors of the building, and never pulls everyone off the job at once.
19Multi-Zone and Multi-Region Designs
The bigger the failure you want to survive, the further apart your copies need to be.
Everything so far protects against a replica or a machine failing. Cloud providers, however, group machines into zones that can fail together, and zones into regions that can, rarely, fail together too. A design that puts all Collector replicas in one zone survives a crashed process but not a zone outage. Spreading replicas across at least three zones means losing one zone leaves two thirds of your capacity, usually enough to carry on.
flowchart TD
subgraph R1["Region one"]
subgraph Z1["Zone A"]
G1["Gateway replica"]
end
subgraph Z2["Zone B"]
G2["Gateway replica"]
end
subgraph Z3["Zone C"]
G3["Gateway replica"]
end
end
APPS["Applications and agents in the region"] --> G1
APPS --> G2
APPS --> G3
G1 --> BE["Backend"]
G2 --> BE
G3 --> BE
Regional gateways
For multi-region systems, a common design gives each region its own gateway tier, so telemetry from a region stays inside that region until it reaches the backend. A regional outage then affects only that region’s telemetry, and cross-region network costs and delays are limited to the final hop.
Sending to more than one destination
A Collector can send the same data to several exporters at once. This allows designs such as writing to a primary backend and a secondary store, or to a long-term archive. It also protects against the loss of a single backend, at the cost of doubled network use and a more complicated picture of where the truth lives.
Benefits of wider spread
- Survives zone and, with regional design, regional failures.
- Keeps telemetry local, reducing delay and cross-region cost.
- Allows independent maintenance windows per region.
- Fan-out can protect against a single backend failing.
Costs of wider spread
- Cross-zone and cross-region traffic is often billed.
- More components to configure and monitor.
- Stateful tiers must keep related data together, which limits how widely they can spread.
- Duplicate data in several stores must be reconciled.
Some data must stay inside a country or region for legal reasons. Routing telemetry across regions for resilience can break those rules, so check data residency requirements before designing cross-region failover.
20Data Flow and Lifecycle: One Span From Birth to Storage
Let us follow one span through an agent plus gateway design and mark every place where something could fail.
sequenceDiagram
participant A as Application
participant G as Agent collector
participant L as Load balancer
participant W as Gateway replica
participant B as Backend
A->>G: Send spans
G->>G: Memory limiter then batch
G->>L: Export batch
L->>W: Route to a healthy replica
W->>W: Process and queue on disk
W->>B: Send batch
B-->>W: Acknowledge
W-->>G: Acknowledge
Application to agent
A short local hop. If the agent is restarting, the application’s own exporter retries briefly. Failure here is rare and short.
Inside the agent
The memory limiter protects against overload and the batch processor bundles data. A crash here loses whatever is in memory.
Agent to gateway
A network hop. The agent’s sending queue absorbs short gateway or network problems and retries with backoff.
Load balancer choice
The balancer picks a ready replica. If the chosen one dies mid-request, the sender receives an error and retries elsewhere.
Inside the gateway
Processing, then a persistent queue on disk. After this point a crash no longer loses the batch.
Gateway to backend
Another network hop with its own retries. A backend outage fills the persistent queue instead of losing data, until limits are reached.
Acknowledgement travels back
Only when data is safely accepted does each stage release its copy, which is the essence of at-least-once delivery.
21Configuration Management and Safe Rollouts
The best redundancy in the world does not help if every replica receives the same broken instruction at once.
A Collector is steered entirely by its configuration, which describes receivers, processors, exporters and pipelines. A single mistake, such as a wrong destination address, a missing processor or an unsuitable memory setting, can silently drop data or crash every replica. Because all replicas usually share one configuration, this is the classic common-cause failure: redundancy does not protect you because every copy is wrong in the same way.
Keep configuration in version control
Every change is reviewed, recorded and reversible. This gives you an audit trail and a quick path back.
Validate before deploying
Use the Collector’s own validation to catch syntax and structure mistakes in a build step, before any replica sees the change.
Test in a non-production environment
Send realistic synthetic traffic and confirm that data arrives complete at a test backend.
Roll out gradually
Update one replica or one small group first, watch queue, refusal and failure metrics, then continue.
Keep rollback ready
Know the exact steps to return to the previous version and practise them, so rollback takes minutes, not hours.
Some teams run a small canary gateway that receives a small share of traffic and runs the new configuration first. If the canary behaves, the change is promoted to the main tier. This turns a risky global change into a small, observable experiment.
Running different Collector versions or configurations in the same tier makes behaviour hard to predict and failures hard to explain. Aim for one known version and one known configuration per tier, with a deliberate, short transition period during upgrades.
22Security as Part of Availability
An insecure Collector is an unreliable Collector, because anyone who can reach it can overload it or feed it garbage.
The Collector accepts network connections, holds credentials for the backend, and sees every piece of telemetry, which may contain sensitive details. Security and availability meet in several places, and ignoring them can turn a small incident into a large outage.
Open receivers
A receiver reachable from untrusted networks invites floods of data that exhaust memory or disk. Restrict who can connect, and prefer private networks.
Unencrypted hops
Data in transit between tiers can be read or tampered with. Use encrypted connections between agents, gateways and backends, ideally with mutual authentication.
Shared credentials
Backend credentials stored in configuration should come from secret storage, be rotated, and be held only by the tier that needs them. A gateway design helps by keeping them in one place.
Noisy neighbours
In shared environments, one tenant’s burst can starve others. Resource limits, separate pipelines and per-tenant quotas contain the damage.
Problem
Receivers on the gateway tier are reachable by many internal systems and sometimes by external ones.
Decision
Expose gateway receivers only on private networks where possible, require encrypted connections with authentication for any caller outside the trust boundary, and apply memory limits and queue limits so that a flood is refused instead of crashing the tier.
Consequence
Overload and abuse are contained and visible, at the cost of managing certificates and credentials, which must themselves be renewed on time, since an expired certificate can stop telemetry as surely as a crash.
Telemetry can include user identifiers and request details. High availability keeps more copies of data in more places, so check retention on disk queues and message queues, and use processors to remove or mask sensitive fields as early in the pipeline as possible.
23Monitoring the Collector Itself
A telemetry pipeline that nobody watches will fail silently, so give it its own small dashboard and its own alerts.
The Collector reports internal metrics about its own behaviour. These are the earliest and most reliable warnings of trouble, because they show queues filling, data being refused and sends failing before any user notices missing telemetry.
| What to watch | What it tells you | Typical response |
|---|---|---|
| Export queue size compared with capacity | How close you are to dropping data | Scale up around sixty to seventy percent, investigate the backend |
| Items refused by the memory limiter | The tier has reached its memory limit | Add capacity or replicas, review batch and queue sizes |
| Failed send counts | The destination or network is unhealthy | Look at the backend and network, not at more Collectors |
| Items dropped or enqueue failures | Data is already being lost | Treat as an incident and raise urgency |
| Restarts and crash loops | Replicas are dying | Check memory limits, configuration changes and recent rollouts |
| Disk usage of persistent queues | How much outage buffer is left | Enlarge volumes, fix the downstream problem, alert before full |
| Ready replica count | Whether redundancy is intact | Page when below the planned minimum |
Monitor from outside the pipeline
If the Collector reports its own health through itself, a failing pipeline cannot tell you it is failing. Send the Collector’s own metrics through a separate, simpler path, or scrape them with an independent system, so that you are told about the problem even when the main path is down. A small synthetic check that sends a test span regularly and verifies that it reaches the backend gives an end-to-end signal that no internal metric can match.
A smoke alarm that runs on the same power circuit as the house will go quiet exactly when the house loses power. Good alarms have their own battery. In the same way, monitoring for your telemetry pipeline should not depend on that very pipeline.
A queue that is slowly climbing for hours tells you about a problem long before it is full. Alerts on rate of change and on the time until a queue fills often give you the extra warning needed to fix a problem during working hours.
24Design Patterns and Anti-Patterns
Patterns capture what usually works and anti-patterns capture what usually hurts, and both are cheaper to learn from a page than from an incident.
Patterns that work
Light agents, strong gateways
Keep agents simple and put heavy processing, credentials and durable queues in a replicated gateway tier that you can manage centrally.
Buffer at every risky hop
Give each network or backend boundary its own queue and retry policy, sized for the outage length you intend to survive.
Stateless routing in front of stateful work
Use a routing tier with trace-aware or service-aware balancing in front of tail sampling and aggregation, so related data always meets in one place.
Canary then roll out
Release configuration and version changes to a small tier first, watching metrics, before the whole fleet changes.
Anti-patterns to avoid
Problem
One single gateway replica handles all traffic because it has been fine so far.
Why It’s Harmful
Any restart, crash or node maintenance causes an outage of the whole telemetry path, and the data in its memory is lost.
Correct Approach
Run at least three replicas spread across failure domains, behind a request-aware balancer, with enough headroom to survive losing one.
Problem
Tail sampling is placed behind a plain load balancer that spreads spans randomly.
Why It’s Harmful
Each replica sees only fragments of each trace, so decisions are made on incomplete information, and valuable traces such as errors may be dropped by mistake.
Correct Approach
Route by trace identifier through a stateless first tier, so every span of a trace reaches the same sampling replica.
Problem
No memory limiter, and a very large in-memory queue configured as a safety net.
Why It’s Harmful
During a backend outage the queue grows until the process runs out of memory and is killed, losing the entire queue at once and triggering a restart storm.
Correct Approach
Use the memory limiter as the first processor, size queues within memory, and use a disk-backed queue where larger buffers are needed.
Problem
Several replicas run the same scraping job without dividing the targets.
Why It’s Harmful
Every target is scraped many times, creating duplicate metrics, inflated totals and wasted cost.
Correct Approach
Shard the targets across replicas with a target allocator, or run a single replica for singleton sources with automatic restart or leader election.
25Best Practices and Common Mistakes
A short checklist is often more useful than a long argument, so here are the habits that separate smooth operations from painful ones.
Best practices
- Run at least three gateway replicas across failure domains.
- Put the memory limiter first and batching near the end of every pipeline.
- Enable sending queues on network-bound exporters and size them for your target outage length.
- Use persistent, durable queues on critical gateways.
- Use request-aware balancing in front of stateless tiers.
- Route stateful work by trace or service key.
- Monitor queues, refusals, failures and restarts, and monitor from outside the pipeline.
- Roll out changes gradually with a prepared rollback.
Common mistakes
- Assuming that two replicas are enough.
- Adding replicas when the real bottleneck is the backend.
- Leaving long-lived connections unevenly balanced.
- Letting all replicas share one untested configuration change.
- Using local disk for persistent queues on machines that can disappear.
- Ignoring certificate expiry and secret rotation.
- Never testing failures until the real one arrives.
For every tier, you should be able to answer three questions in one sentence each: what happens when one replica dies, what happens when the next stage is unavailable for ten minutes, and how will I know it happened?
26Real-World Scenarios
Examples help the ideas settle, so here are four situations that teams commonly meet.
A growing startup on a container platform
The team starts with a per-node agent and a three-replica gateway across zones, with disk-backed queues on the gateway. A short backend maintenance window passes without a single gap in traces, because the queue absorbs the outage.
An online retailer preparing for a sale
Ahead of a large sale, the platform team load tests the gateway tier, discovers that long-lived connections concentrate traffic on a few replicas, and switches to a request-aware balancer. During the sale, spikes are spread evenly and memory limiter refusals stay at zero.
A bank with strict tail sampling needs
The bank keeps every trace that contains an error and a small share of the rest. A trace-aware routing tier feeds a set of sampling replicas, each with generous memory. They plan scaling events for quiet hours to limit trace splitting.
A large platform with regional data rules
Each region runs its own gateway tier, with data staying inside the region until it reaches a regional backend. A zone failure in one region reduces capacity by a third there and is invisible elsewhere.
27Advantages, Disadvantages and Trade-offs
Every safeguard buys protection and charges a price, so it helps to see them side by side.
| Technique | Protects against | Price you pay | What still goes wrong |
|---|---|---|---|
| Several replicas | One process or machine failing | More compute, more to manage | Shared bad configuration, zone-wide failures |
| Memory limiter | Crashes during spikes | Some data is refused during overload | Senders without retries lose refused data |
| In-memory sending queue | Short backend or network hiccups | Memory use | Collector crash or long outage |
| Persistent queue on disk | Crashes, restarts, longer outages | Disk, disk speed, monitoring | Disk loss with the machine, disk filling up |
| Message queue between tiers | Very long outages, extreme bursts | A whole extra system to run | Message queue failure or retention limit reached |
| Multi-zone spread | A zone outage | Cross-zone traffic cost | Region-wide failure |
| Fan-out to several backends | Loss of one backend | Doubled network use, duplicate data | Both backends affected by the same problem |
Advantages of a highly available design
- Single failures become non-events.
- Backend maintenance no longer creates gaps in telemetry.
- Applications are shielded from telemetry slowness.
- Rolling upgrades are safe and routine.
- You can state and test what data loss you tolerate.
Disadvantages and trade-offs
- More infrastructure to build, pay for and maintain.
- Stateful processing limits how freely you can scale.
- At-least-once delivery brings occasional duplicates.
- More buffers mean more places where stale data can sit.
- Complexity itself becomes a failure source if untested.
The sensible approach is to climb the ladder only as far as your needs require. Many teams reach their goal with replicas, a memory limiter and sending queues alone. Persistent queues come next for critical gateways. Message queues and multi-region fan-out are for the few systems where the cost of losing telemetry is very high.
28A Worked Sizing Example
Let us size a gateway tier with real arithmetic, using illustrative numbers you can replace with your own.
Suppose your system produces thirty thousand spans per second at peak, and you decide that the telemetry pipeline must ride out a ten-minute backend outage without losing data, even while one gateway replica is down. These numbers are illustrative, and the average size of one serialised span is assumed to be about one kilobyte.
Choose the replica count
Three replicas, spread over three zones. Under normal conditions each handles ten thousand spans per second.
Compute the worst-case rate per replica
With one replica missing, the remaining two share thirty thousand spans per second, so each handles fifteen thousand.
Compute data to buffer
Ten minutes is six hundred seconds. Fifteen thousand spans per second multiplied by six hundred seconds is nine million spans per replica.
Convert to storage
Nine million spans at about one kilobyte each is about nine gigabytes per replica. Add fifty percent headroom to reach roughly fourteen gigabytes, and round up to a twenty-gigabyte volume.
Check the retry window
The default retry effort lasts about five minutes. To survive ten minutes, the retry window must be lengthened beyond ten minutes, otherwise queued data would be given up on early.
Nine gigabytes of in-memory queue per replica would demand very large machines and would vanish on any restart. This simple calculation shows why longer outage targets push designs toward disk-backed queues.
Remember that this arithmetic assumes the backend recovers and then drains the queue faster than new data arrives. If recovery is slow, the queue keeps growing, so the sizing must also consider how quickly the backend can catch up. Treat the result as a starting point to be checked with a real test, not as a promise.
29Testing Your Design: Game Days and Failure Drills
A resilience feature you have never tested is a hope, not a design.
Failures are best met for the first time on a quiet afternoon, with the team watching, not at night during a real incident. A game day is a planned exercise in which you deliberately cause a failure and confirm that the system behaves as designed. Start in a test environment, then repeat carefully in production once you trust the results.
| Drill | How to cause it | What you should observe |
|---|---|---|
| Kill one gateway replica | Stop a single replica suddenly | Senders retry elsewhere, no gap in data, replacement starts, queue metrics stay calm |
| Short backend outage | Block the backend for a few minutes | Queues fill and then drain, no data loss, alerts fire at planned levels |
| Backend outage beyond the window | Block the backend longer than the retry window | Loss begins at the point you predicted, alert fires, behaviour matches your sizing |
| Traffic surge | Send several times normal volume | Memory limiter refuses data without crashes, senders retry, autoscaling reacts |
| Disk fills up | Shrink the volume or fill it | Alert before full, graceful behaviour at full, no corruption |
| Rolling restart | Restart the tier one replica at a time | No lost data, no spike of errors on senders |
| Zone loss | Remove all replicas in one zone | Remaining replicas absorb load within their headroom |
| Bad configuration on the canary | Deploy a deliberately broken change to the canary only | Canary fails visibly, main tier untouched, rollback is quick |
| Expired certificate | Use a short-lived test certificate | Alert on expiry in advance, clear error messages, quick renewal |
For each drill, write down the expected outcome before you start and compare it with what really happened, including how long detection took. The gap between expectation and reality is where your next improvement lives.
30Troubleshooting Guide
When something looks wrong, a symptom-first table gets you to the right question quickly.
| Symptom | Likely cause | What to check first |
|---|---|---|
| Gaps in telemetry during deployments | Replicas restart without draining, or too many restart at once | Graceful shutdown period, update surge settings, readiness checks |
| One replica is busy, others idle | Connection-level balancing of long-lived connections | Balancer type, connection lifetime limits |
| Collector keeps getting killed | Memory limit exceeded or missing memory limiter | Memory limiter placement, queue sizes, container limits |
| Queue keeps growing even after adding replicas | Backend or network bottleneck | Failed send counts, backend health, network capacity |
| Duplicate metrics | Several replicas scrape the same targets | Target sharding, singleton source handling |
| Many incomplete traces after scaling | Routing key changes reshuffled stateful replicas | Membership change timing, headless discovery, scaling frequency |
| Data vanishes after a node loss | Persistent queue on local disk that died with the node | Volume type and durability |
| All replicas fail right after a change | Bad shared configuration | Recent configuration, canary results, rollback |
| Sudden total silence | Expired certificate or rotated credential | Certificate dates, secret rotation logs, authentication errors |
A calm way to debug
Find the first place where data stops
Follow the path from application to backend and check each stage’s counters for what came in and what went out. The first stage where the numbers differ is the place to investigate.
Ask what changed
Recent deployments, configuration changes, certificate renewals and traffic shifts explain most sudden problems.
Stabilise before optimising
Roll back, add temporary capacity or reduce incoming volume first. Understand the deeper cause once the system is calm again.
31Traces, Metrics and Logs Fail Differently
The same Collector carries three kinds of data, and each kind has its own tolerance for loss, delay and duplication.
It is tempting to design one resilience policy for everything, but the three signal types behave differently when something goes wrong. Understanding those differences lets you spend your protection budget where it matters most and relax it where it does not.
Traces
Each trace is a story made of many spans. Losing some spans leaves holes, and losing a whole trace is usually acceptable if sampling already thins them. Duplicates are mostly harmless. Stateful tail sampling is the main HA challenge.
Metrics
Metrics are numbers over time. A short gap shows up as a hole in a graph, and a duplicate can double a total. Pull-based scraping brings the duplicate problem, so sharding and single-writer designs matter most.
Logs
Logs are records of events and are often needed for audits and incident forensics, so loss hurts more. Volume can be enormous, so disk-backed buffering and remembering read positions are the key HA concerns.
| Question | Traces | Metrics | Logs |
|---|---|---|---|
| How bad is a short gap? | Some incomplete traces | A visible hole in graphs and possibly missed alerts | Missing evidence for investigations |
| How bad is a duplicate? | Usually minor | Can distort totals | Usually minor, but noisy |
| Main stateful concern | Keeping whole traces together | Keeping one scraper per target | Remembering file read position |
| Typical buffering need | Moderate, sampling thins volume | Low volume, but timeliness matters | High, often the largest volume |
| Strongest protection to consider | Trace-aware routing tier | Target allocator or leader election | Persistent queues and durable read positions |
Think of three kinds of mail. A postcard from a friend is nice to receive but not tragic if it is lost, which is like a sampled trace. A utility meter reading must arrive exactly once or the bill is wrong, which is like a metric. A legal document must arrive and be kept for years, which is like an audit log. A good postal service handles each differently.
Because the Collector supports several pipelines side by side, you can give each signal its own queue sizes, retry windows and storage. Spending heavily on durable buffers for logs while keeping trace queues lean is a perfectly sensible design.
32Setting Reliability Targets for the Pipeline
You cannot design for a goal you have never written down, so give your telemetry pipeline its own simple targets.
Engineering teams routinely set targets for the services they run, such as how fast a page should load. The telemetry pipeline deserves the same treatment, because everyone depends on it during incidents. A small set of targets turns vague wishes like “very reliable” into numbers that drive design and alerting.
Completeness target
The share of produced telemetry that reaches the backend over a period, for example ninety-nine point nine percent over a month. This sets how much loss you may tolerate in total.
Freshness target
How long after an event the data should be visible, for example ninety-five percent of data visible within one minute. This sets how much delay queues and retries may add.
Outage tolerance target
The longest backend or network outage the pipeline should ride out without loss, for example ten minutes. This sets queue sizes and retry windows, as in the sizing example.
Recovery target
How quickly a failed replica or tier must be back, for example within a few minutes. This sets health check settings and automation needs.
| Monthly completeness target | Allowed loss out of every million items | What it implies |
|---|---|---|
| 99% | 10,000 | Replicas and basic queues are usually sufficient |
| 99.9% | 1,000 | Persistent queues and tested failover become important |
| 99.99% | 100 | Multi-zone spread, durable buffers, strict change control |
| 99.999% | 10 | Message queues, multi-region design, heavy operational discipline |
Think of a courier promise. Same-day delivery with ninety-nine percent reliability is cheap. Same-day delivery with ninety-nine point nine nine nine percent reliability needs spare vehicles, backup drivers and real-time tracking. Each extra nine multiplies the cost, so choose the number the business actually needs.
Telemetry is usually diagnostic, not transactional. Promising extreme reliability for data that is sampled anyway wastes money. Reserve the highest targets for audit logs and other data with real legal or financial weight.
33The Cost of Availability
Resilience is not free, and a good design makes the price visible so that the team can decide what to buy.
Every layer of protection carries a cost. Some costs are obvious, such as more machines. Others are quieter, such as network charges for crossing zones, disk space for queues, or the time engineers spend maintaining more moving parts. Looking at the bill by category helps you spot where a small design change can save a lot.
Compute and memory
Extra replicas and headroom for failure mean you pay for capacity that sits idle most of the time. That idle capacity is exactly what you are buying.
Storage
Persistent queues and message queues need durable disks and retention space, sized for your outage target.
Network
Cross-zone and cross-region transfer is often billed. Spreading replicas widely and fanning out to several destinations multiplies traffic.
People and time
More tiers mean more configuration, more upgrades, more alerts and more drills. Complexity must be paid for in attention.
Ways to spend less without losing safety
Reduce data before it travels far
Filtering unwanted data, dropping noisy attributes and sampling early all shrink the volume that must be buffered, replicated and sent. Smaller data makes every protective layer cheaper.
Compress between tiers
Compressing traffic between agents, gateways and backends trades a little processor time for much lower network and storage use.
Tier your protection by signal
Give durable buffering to data that truly needs it and keep other pipelines lean, as discussed earlier.
Scale on schedule where traffic is predictable
If load follows a daily rhythm, scheduled scaling avoids paying for peak capacity around the clock while keeping the minimum replica count intact.
Ask for every layer: how much would an hour of lost telemetry cost us during an incident, and how often might that happen? If the layer costs more per year than the expected loss, simplify it. If it costs far less, it is probably a bargain.
34An Incident Runbook for Collector Outages
When the pipeline itself is in trouble, a short, rehearsed checklist beats clever improvisation.
A runbook is a short document that tells an on-call engineer what to do first, second and third. Writing one for the Collector tier before it is needed turns a stressful, confusing night into a series of small, calm steps. The best runbooks are short, specific to your setup, and tested during the failure drills described earlier.
Confirm the scope
Is data missing for everything or only for some services, zones or signal types? Scope points you toward the failing tier or boundary.
Check redundancy
How many replicas are ready in each tier compared with the planned number? If redundancy is gone, restoring it is the first goal.
Read the queues
Look at queue fullness, refused items and failed sends. Rising failures with full queues point downstream; refusals point to capacity.
Review recent changes
Deployments, configuration changes, certificate renewals and traffic events in the last day explain most incidents. Roll back if a change lines up with the start of the problem.
Protect what is buffered
Avoid restarting everything while queues hold data in memory. Prefer actions that preserve queued data, such as fixing the downstream problem first or restarting one replica at a time.
Communicate and record
Tell the teams that depend on telemetry which data is missing and for how long, and keep a timeline so that the gap can be explained later.
Learn afterwards
Run a short review: which metric warned first, which drill would have caught this, and which setting should change.
Restarting a struggling Collector feels productive, but if its queue lives only in memory, a restart destroys exactly the data you are trying to save. Understand what is buffered where before pressing the restart button.
35Maturity and Ecosystem
A tutorial should be honest about the changing parts, so here is how to stay safe on moving ground.
The Collector is built from many components, and each one has its own stability level, which the project documents publicly. Some are considered stable, while others are still maturing, and components can change names, options or defaults between releases. The core ideas in this tutorial, replicas, memory protection, queues, retries, routing and monitoring, are lasting. The exact option names and default values are not, so always verify them against the documentation for the version you run.
Deployment and scaling guides
The official guides describe the agent and gateway patterns, signals to watch for scaling, and the replica guidance used throughout this tutorial.
Resiliency guide
Explains sending queues, retries, persistent storage, message queues and the situations in which data can still be lost.
Operator and target allocator
Automates deployment on container platforms and divides scrape targets across replicas.
Contrib components
Many of the pieces discussed here, such as the load-balancing exporter and tail sampling, come from the broader community collection, so check each one’s stability and your distribution’s support.
Read the release notes before every upgrade, and treat upgrades themselves as a failure drill. Test them first on the canary tier, since changes in defaults are a common source of surprises.
36Frequently Asked Questions
It is the practice of running redundant, well-buffered, well-monitored Collector tiers so that crashes, restarts, traffic spikes and backend outages do not turn into lost or unreachable telemetry.
The scaling guidance recommends at least three for resilience. Size the group so the remaining replicas can carry peak load with one missing.
Small systems can work well with agents only. A gateway becomes valuable when you need central configuration, shared credentials, heavier processing, or a resilience boundary between applications and the backend.
It refuses new data when memory is nearly exhausted, instead of letting the process be killed. Senders are told to retry, and data already accepted is protected.
If losing queued data on a crash or restart would be costly, yes, especially at gateways. For small agents holding little data, in-memory queues are often enough. Make sure the disk itself survives the failures you care about.
When outages of the next tier may exceed what local queues can cover, when bursts are extreme, or when several consumers need the same stream. For many systems it is more complexity than needed.
Because each replica must see all spans of a trace to decide about it. A normal balancer spreads spans randomly, so each replica sees fragments. Route by trace identifier instead.
Most likely several replicas scrape the same targets. Divide the targets among replicas with a target allocator, or run singleton sources as a single replica or with leader election.
Not absolutely. You can promise no loss for defined failures, such as one replica dying or a backend outage shorter than your buffer window, and bounded, alerted loss beyond that.
When the bottleneck is downstream, for example a slow backend or a saturated network. Rising failed sends and queues that stay full despite more capacity are the clues.
Watch queue size against capacity, items refused, failed sends, drops, restarts, disk usage and ready replica counts, and add an end-to-end synthetic check that travels through the real path.
Two causes dominate in practice: running out of memory during a spike, and a faulty change rolled out to every replica at once. A memory limiter and staged rollouts address both.
37Summary and Key Takeaways
We began with a city that depended on a single post office and saw how the same fragility can sit inside any observability setup that depends on one Collector. High availability design replaces that fragility with a few repeatable habits. Run several replicas across failure domains behind a balancer that spreads real requests. Protect each Collector’s memory so spikes cause polite refusals, not crashes. Put queues at every risky boundary, move them to disk where crashes matter, and add a message queue only where the outage you must survive is long. Route stateful work, such as tail sampling, by trace or service key, and shard pulling receivers so nothing is scraped twice. Spread copies across zones, roll changes out gradually, secure every hop, and watch the Collector with monitoring that does not depend on the Collector. Finally, test each promise with deliberate failure drills, because the only reliable design is the one you have already seen survive.
Key Takeaways
- Redundancy first — run at least three gateway replicas across failure domains, with headroom to lose one.
- Memory protection — put the memory limiter first so overload causes refusals, not crashes.
- Buffer at the boundaries — use sending queues and retries, disk-backed queues for critical tiers, and message queues only for long outage targets.
- Route stateful work deliberately — send all spans of a trace, or all data of a service, to the same replica, and shard scrape targets to avoid duplicates.
- Know your guarantees — delivery is at-least-once, so state which failures lose nothing and bound everything else.
- Make changes safe — validate, canary, roll out gradually and keep rollback ready, because shared bad configuration defeats redundancy.
- Watch and test — monitor queues, refusals, failures and restarts from outside the pipeline, and prove the design with failure drills.