Skip to main content

How to Set Different Retention Periods for SMART and Operational Metrics

GuideWritten by oncall.fyi editorialPublication approved by Burak YApproval recorded 12 September 2026
Sources and verification
Source dates
Oldest source check: 12 September 2026.
Technical verification
Separate technical verification has not been recorded.

Publication approval and technical verification are recorded separately. Automated link checks establish reachability, not accuracy. A checked example verifies only its stated test cases, not the whole article or your production setup.

In short

Choose retention from the decision each metric supports. Keep short, detailed operational history for recent troubleshooting and a separate long-term path for disk-health trends that need comparison across months. Prometheus local retention applies to its storage instance, not arbitrary individual metrics. Use separate stores or a backend with documented retention controls, and test both historical queries and missing-data detection before removing the old collection path.

Key takeaways

  • A single local Prometheus retention setting does not implement per-metric retention.
  • Long-term aggregation must preserve the diagnostic facts you care about.
  • A quiet disk-health chart can mean failed collection rather than a healthy disk.

Start with the question each history answers

A CPU chart used to diagnose yesterday's deployment and a disk attribute used to investigate a months-long deterioration need different histories. Write down the longest comparison window and the resolution each question requires. Retention without a purpose tends to become either an expensive default or a gap discovered during an incident.

For disk health, include device identity, collection time and the attributes relevant to the installed hardware. Keep the meaning of attributes tied to the device and exporter documentation. A raw attribute value is not a universal failure threshold across all disk vendors, and a drive passing a health check does not guarantee it will remain usable.

Choose the storage boundary deliberately

Prometheus local storage (opens in a new tab) documents time and size retention settings for the instance. Those settings are not a per-metric policy language. Setting a longer retention on the same instance retains other collected series as well, subject to size constraints.

DesignUseful whenExtra responsibility
Separate Prometheus instancesThe long-term set is small and operationally simpleTwo stores, backups and queries to maintain
Remote-write selected seriesA suitable long-term backend already existsDelivery lag, queue failures and destination limits
Backend with documented retention policiesThe product supports the desired policy boundaryVerify edition, scope and deletion behavior

These are architecture options rather than a claim that every backend supports all three. Choose one that your team can operate. A remote store without a tested query or restore path can become an expensive archive that nobody can use.

Select long-term series explicitly

Maintain an allowlist of required metric families and labels. Keep stable device identity so replacements do not masquerade as one continuous disk. Avoid per-request labels and other unbounded dimensions in the long-term path. Review the cardinality budget before retaining an exporter wholesale.

Prometheus remote-write configuration (opens in a new tab) provides write relabeling for selecting samples sent to a destination. That filtering does not change what remains in local storage. Conversely, dropping a sample before local ingestion can also remove it from downstream uses. Draw the actual collection and forwarding order before choosing the filter location.

Record where rules run. A long-term destination should not accidentally become a synchronous dependency for an urgent local alert. Preserve a current, sufficiently fresh signal for paging even if the historical store is unavailable.

Choose aggregation that preserves meaning

If detailed short-term samples are reduced for long-term storage, decide what each summary loses. An average temperature can hide a brief maximum; a counter needs reset-aware handling; a missing interval must not become an invented zero. A device replacement can look like a reset unless identity changes are retained.

Store the summaries needed for the question, such as appropriate extrema and counts alongside an average. Keep enough raw history to investigate recent anomalies. Do not average different devices together merely to save series if the intended decision is which disk needs investigation.

Test history, continuity and failure

Pick one test device or an existing noncritical exporter. Query a recent interval in both stores, then an older interval available only in the long-term path. Verify timezone, units, labels and expected resolution. Test a collection gap and confirm the display identifies stale or missing data rather than extending the last healthy sample indefinitely.

Exercise a destination outage and inspect forwarding lag and recovery using the installed collector's documented limits. Confirm that local urgent alerts still evaluate. Restore a backup of the long-term store into an isolated environment and run a representative historical query; file existence alone is weak evidence of usable history.

Finally, remove the redundant old path only after the acceptance checks pass. Record deletion timing and rollback limits: changing retention back cannot recover samples already deleted. Review the policy when hardware, exporters or the questions you ask of the data change.

Did this help?

Your answer helps us improve this guide. We save only the page and your choice for 30 days.

No name, email, or incident details are requested.

Sources

Vendor facts change. Each source below shows the date this page last checked it.

  1. Prometheus storage Prometheus. Checked 12 September 2026.
  2. Prometheus remote-write configuration Prometheus. Checked 12 September 2026.

Related

One practical idea, occasionally

The On-Call Brief: short field notes, templates, and operational lessons.

Follow the field guide

Email subscriptions are not open yet. Read new guides in your feed reader — no email address needed.

Subscribe with RSS