TECHNOLOGY

Prometheus sample limits: one new metric can fail the whole scrape

In this article
THE QUICK TAKE

A sample limit is a whole-scrape acceptance boundary after metric relabeling, not a promise to keep the first allowed samples.

The diagnostic situation

A serving exporter adds a diagnostic metric family. Existing dashboards lose unrelated model metrics at the same moment. The exporter still answers requests, so the incident is blamed on dashboard selectors. The Prometheus scrape can instead have crossed a configured sample limit, causing the entire scrape to be treated as failed rather than merely truncating the newly added family.

Why the observation changes meaning

Prometheus configuration documents sample_limit after metric relabeling as a whole-scrape failure condition. Label-count and label-length limits have their own related acceptance rules. These boundaries differ from SDK cardinality overflow aggregation, which can preserve a synchronous total in an overflow series. Do not assume every telemetry limit discards only excess fields or preserves a partial successful result.

Define the instrumentation contract

Record effective scrape limits, target identity and metric-relabel configuration. Define which required metric families must survive a rollout. Compare exporter exposition with scrape diagnostics and stored application series. Keep collection failure separate from inference failure: a reachable exporter can supply too many samples while the model serves normally, and a failed scrape does not identify the application’s user-visible outcome.

A bounded verification procedure

Create a test exporter with a bounded controllable number of series. Observe it below the chosen limit, then add enough synthetic samples to cross the boundary. Compare raw response size, scrape outcome and visibility of an unrelated required metric. Repeat with a targeted metric-relabel reduction, documenting that exporter generation still occurs. Verify the actual configured server rather than copying a default from documentation.

Evidence required for acceptance

Acceptance evidence includes configuration, sample inventory, before/after scrape observations and the resulting stored series. Show that the test distinguishes whole-scrape failure from an intentionally removed family. Validate alerts for collection loss without filling missing model values with zero. A successful recovery after raising the limit should also document the increased series budget and resource implications.

Failure cases and limits

Raising limits can move pressure into ingestion or storage, and dropping critical labels can create identity collisions. The protocol validates an acceptance boundary, not a universal recommendation to remove limits. It does not prove complete historical collection or service health. Existing retention, stale series and downstream transformations still affect what appears in the diagnostic query after the scrape configuration is corrected.

A sample limit is a whole-scrape acceptance boundary after metric relabeling, not a promise to keep the first allowed samples. Prometheus scrape configuration; Prometheus jobs and instances.

The proposed investigation of scrape sample limit whole failure is not an executed deployment benchmark. Related reading: A metric disappeared from the graph: staleness, up and zero values; Prometheus relabel_configs vs metric_relabel_configs: where to filter data.

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles