Published

Prometheus Remote Write Backpressure: Diagnose Before Adding Shards

Diagnose Prometheus remote write backpressure with sender metrics, receiver errors and reversible queue changes before increasing shard concurrency.

Steel industrial tanks with a vertical maintenance ladder

Prometheus is scraping successfully, local dashboards still work, and the remote metrics backend is falling behind. The tempting response is to increase the number of remote write shards. That can help a throughput problem, but it can also increase memory use or put more pressure on a receiver that is already throttling requests. Start by establishing where the backlog forms and which constraint is actually limiting delivery.

This article describes a diagnostic and reversible change process for an existing Prometheus remote write deployment. It uses the upstream tuning guide, configuration reference and protocol specification, with Amazon Managed Service for Prometheus as one example of a receiver with documented quotas. It does not assume that every compatible receiver has the same limits, error handling or capacity model.

Identify the sender, destination and affected time window

Record the Prometheus version, destination URL, receiver type, authentication method, active configuration revision and the beginning of the incident. Keep credentials and signed request material out of shared troubleshooting notes. Determine whether the problem affects one sender, several replicas or every destination. A single Prometheus server can have multiple remote write destinations, and they should not automatically be treated as one failing pipeline.

Define an observable symptom before changing configuration. Examples include a rising pending-samples gauge, a growing delay between collection and remote availability, repeated request errors or receiver-side throttling. Check whether local collection is also affected. If local scraping is already unhealthy, a remote queue adjustment will not by itself restore missing collection. Preserve a baseline covering both sender and receiver so the later change has a meaningful comparison.

Understand what is queued and what can block

The upstream tuning guide describes a queue for each remote write destination reading from the write-ahead log and distributing samples to shards. When a shard fills, progress through that path can be blocked. The guide also makes clear that remote write is not an unlimited durable delivery service: an extended destination outage can outlast the available WAL data. Check the behavior documented for the deployed version rather than assuming that eventual recovery means every sample will arrive.

Treat three observations separately: successful collection, available local data and confirmed remote ingestion. They are related but not equivalent. A healthy local query is useful evidence that local collection continued; it is not proof that the remote receiver accepted the same interval. If delivery evidence is incomplete, preserve the uncertainty in the incident record instead of declaring that the backlog was harmless.

Classify receiver responses before tuning concurrency

Inspect bounded sender logs and the receiver’s documented error information. Separate authentication or authorization failures, malformed or rejected samples, transient server errors and explicit rate limits. Do not group every non-success response under a single label such as network failure. A larger queue will not correct an invalid credential or a payload that the receiver consistently rejects.

The remote write protocol specification distinguishes retryable server failures from errors that should not simply be repeated indefinitely. Its treatment of HTTP 429 also needs to be read together with the sender’s supported configuration and the receiver’s guidance. Amazon’s troubleshooting documentation, for example, links some 429 responses to ingestion quotas. Use that information to investigate the actual limit; adding parallel requests is not evidence that the limit has increased.

Compare input pressure with delivery capacity

Observe the incoming sample rate, pending samples, request duration, retries and the receiver’s accepted ingestion over the same time range. The upstream guide specifically identifies prometheus_remote_storage_samples_pending as a useful signal when remote delivery falls behind. Inspect the metrics actually exposed by the installed version and their labels before copying a dashboard or an alert expression from another deployment.

Look for a change in workload rather than only a change in configuration. A new scrape job, label churn, shorter scrape intervals or a receiver-side incident can alter the balance. Compare affected and unaffected replicas where they exist. Record whether the apparent improvement comes from better delivery, reduced incoming data or a changed query window. Those outcomes require different operational explanations and may imply different follow-up work.

Inspect sender resources and the path to the receiver

Check CPU, memory pressure, container limits, restart history and network behavior during the affected interval. Remote write adds work beyond local scraping. A sender that repeatedly restarts while attempting to drain its backlog may need a resource and workload investigation before additional concurrency is appropriate. Confirm that the receiver address and authentication configuration are the intended ones for this environment.

Review recent deployment, routing and proxy changes without exposing secrets in the evidence package. Where a network test is appropriate, keep it within the approved environment and interpret it narrowly: reaching a host does not prove successful authenticated ingestion. Preserve timestamps and scope for each observation. The aim is to connect the delivery symptom to a supported explanation, not accumulate unrelated diagnostic output.

Read queue settings as a combined resource decision

The configuration reference defines the settings available under the remote write destination, including queue behavior. capacity, max_samples_per_send and the shard limits influence different parts of that behavior. The tuning guide explains that queue and shard choices also affect memory consumption. Increasing multiple settings together makes it harder to determine which change helped and can make a resource problem worse.

Prometheus already adjusts its active shard count within configured limits. Compare the observed behavior with those limits before raising them. If evidence points to a receiver-side quota, work on the permitted ingestion pattern or receiver capacity rather than assuming more shards will remove the quota. If the evidence points to a constrained sender, quantify the resource headroom needed for the proposed change. Keep the rationale specific to this destination and workload.

Run one reversible change with explicit acceptance checks

Save the current configuration and identify the person authorized to approve the change. State the hypothesis, the single setting or related small group of settings being changed, the observation window and the rollback condition. Confirm the configuration using the tooling appropriate to the installed Prometheus release before applying it. For a replicated deployment, choose a rollout sequence that leaves an interpretable comparison.

Acceptance should cover more than a falling backlog gauge. Check sender resource usage, receiver acceptance, delivery delay, errors and continuity for representative series. Verify the relevant labels and time intervals in both local and remote queries where possible. A restart that temporarily clears a dashboard or a reduction in collected series can make one graph look better without establishing reliable delivery. Record the outcome against the original hypothesis.

Validate recovery and describe any remaining data gap

After delivery stabilizes, inspect the incident interval at the remote destination. Identify whether representative series contain gaps and whether a recovery claim can be supported by the available sender and receiver evidence. Do not infer complete historical delivery from the current health of the endpoint. If an outage exceeded the available buffering behavior, document the affected window and what can and cannot be recovered.

Review alerts so they reflect the operational problem: sustained delivery delay, retry pressure, resource exhaustion or receiver rejection, as appropriate to the deployment. Assign ownership for checking receiver limits when workloads change. Keep a small runbook containing the validated metrics, the receiver’s error references, the last useful baseline and the rollback procedure. That makes the next incident a comparison with known behavior instead of a fresh round of speculative tuning.

Connect the queue investigation to the wider telemetry design

If repeated incidents are driven by unnecessary series or unstable labels, investigate the instrumentation and collection pipeline as a separate change. A delivery queue should not become the permanent workaround for an uncontrolled workload. Equally, removing useful telemetry during an incident should not be presented as an architectural improvement without reviewing the monitoring requirements and the effect on detection.

The related OpenTelemetry gateway article explains an earlier control point for telemetry volume and cardinality: https://tcinfra.dev/opentelemetry-gateway-cardinality-control/. Use that broader review after the immediate delivery path is understood. The practical objective is a measurable balance between incoming telemetry, sender resources and receiver capacity, with enough provenance to explain both a successful change and a decision to roll it back.

Sources

Browse all writing · RSS feed

Tymur Chmeruk

Written by

Tymur Chmeruk

Cloud Security & Infrastructure Engineer · Baltimore–Washington Metro · [email protected]