Deleting series and reclaiming space in Prometheus

Deleting Prometheus series is a deliberate, admin-only operation that marks data for removal and needs follow-up to free disk. This page explains the delete_series workflow, tombstone cleanup and how to keep deleted series from coming back.

On this page

When teams need to delete series in Prometheus

Teams need to delete series in Prometheus when data already stored in the TSDB should not be there: a metric that exploded into millions of series from an unbounded label, a label that leaked a customer identifier or credential, or a bad deployment that wrote junk for hours. The short answer is that Prometheus can remove stored series through its delete_series admin API, but that is a repair step, not a cleanup routine. Prometheus is built to keep samples for the configured retention and to treat them as read-only history, so the first question is whether the data will age out on its own or whether it must go now.

According to the Prometheus storage documentation, the storage layer is a local time series database with a write-ahead log and two-hour blocks, and it is not clustered or replicated. The docs say it should be managed like any other single-node database. For you, that means a deletion is an operation on one server's data directory, with no second copy to fall back on. Before running anything, confirm your retention settings, check whether you have remote write or a snapshot to recover from, and decide who approves the deletion. The admin API is disabled by default and must be enabled with the --web.enable-admin-api flag, which also exposes other destructive endpoints. Review the Prometheus security model before turning it on, and restrict who can reach it.

The deletion request matches series with a selector, usually through the match[] parameter, and marks them for removal. The space is not freed immediately. Deleted series leave tombstones, and disk is reclaimed only after the tombstones are cleaned up, a second step covered in the next section. Also confirm that the deletion will not silently return: if the same metric is still scraped with the same labels, new samples will appear as soon as the next scrape lands, so the scrape configuration or relabeling must change at the same time. Test the selector against a non-production instance first, and record the exact selector, time range and approver so the action can be audited later.

Choosing between delete_series, relabeling and retention

This table compares the four ways to remove or stop series in Prometheus: the delete_series admin API, relabeling rules, retention limits and rebuilding from remote storage. Read each row to see what the option removes, what it leaves behind, and when it is the right tool. The main takeaway is that deletion cleans up history, while relabeling and retention are the controls that keep unwanted series from coming back.

OptionWhat it removesTrade-offWhen it fits
delete_series admin APIMatching series over a chosen time range, already stored on diskAdmin API must be enabled, deleted data stays on disk as tombstones until cleaned, and it does not stop future ingestionRemoving a sensitive label value or a bad metric from past data
Relabeling (drop or keep rules)Stops matching series from being written after the changeDoes not touch data already stored, so history remains until retention ages it outBlocking a noisy metric or label before it inflates the series count
Shorter retention or size limitsData older than the new time or size limit, applied as blocks expireRemoves everything in the window, not just the unwanted series, and is a blunt toolLowering disk use when all old data is low value
Rebuild from remote storageLocal data is replaced by a fresh database that reads history from a remote storeOnly works if remote write was configured earlier, and the local copy is not a clean delete of the bad seriesRecovering from corruption or a mistaken deletion when a remote copy exists

Running a series deletion safely

This sequence removes unwanted or sensitive series with a confirmed scope, a recoverable copy of the data, a short admin API window, and verification that the series are gone and stay gone.

  1. Confirm the matchers with a read-only query

    The engineer responsible for the data runs the intended series selector as a plain PromQL query in the Prometheus UI or through the query API, so nothing is changed yet. Review the returned series label sets, the count, and the time range they cover, and confirm that no shared or production series match by accident. Save the exact matcher text and the time range in the change record. The step is done when the reviewer signs off that every returned series should be removed.

  2. Back up the data directory or take a snapshot

    Before any deletion, the platform owner takes a consistent backup using the TSDB snapshot process described in the backup topic for this pillar, then copies it off the host. Deletion through the admin API is irreversible for the affected samples, so the backup is the only way back if the matchers were wrong. Record the snapshot name, its location, and a successful restore test or checksum. The step is done when the copy exists outside the Prometheus host and someone other than the operator has confirmed it is readable.

  3. Enable the admin API for the window only

    The administrator adds the --web.enable-admin-api flag to the Prometheus startup configuration and restarts the server, since the admin API is disabled by default. Limit access to the endpoint with the network controls or the authenticating reverse proxy already in front of Prometheus, so only the operator's host can reach it. Confirm the flag took effect by calling a read-only endpoint from the allowed host. The step is done when the admin API responds from the permitted source only, and the change ticket records the start time.

  4. Call the delete_series endpoint with the confirmed matchers

    The operator sends a POST request to the delete_series endpoint using the exact matchers from the first step, with the start and end times recorded in the change. Use the same selector text, not a broader one, and avoid open-ended time ranges unless they were approved. Keep the response and any error in the change record. The step is done when the endpoint accepts the request, and the operator notes the matcher, time range, and request time.

  5. Trigger or wait for tombstone cleanup

    Deletion writes tombstones that mark the samples as removed, and the disk space is reclaimed only when those tombstones are cleaned up during compaction. The operator checks the storage documentation for the cleanup endpoint in the Prometheus version in use, then either triggers cleanup or waits for normal compaction. Monitor disk usage on the data volume across this period, and confirm the expected free space appears. Disk usage may not drop immediately, so the step is done only when the operator has observed the cleanup or the reviewer accepts a documented wait.

  6. Verify the series are gone with queries

    The operator reruns the matchers from the first step and confirms that no series return for the deleted time range. Then the operator runs a few queries against nearby, legitimate series to confirm that nothing else was removed. Compare the results with the pre-deletion record and the backup where needed. The step is done when the deleted selector returns no data and the control queries match their expected results.

  7. Prevent the series from returning

    If the series come back on the next scrape, the source is still emitting them, so the team adds relabeling rules that drop the metric or label set at scrape time, or fixes the instrumentation. The engineer checks the target configuration and confirms the dropped series do not reappear in a fresh query after a few scrape cycles. Record the relabeling change in version control. The step is done when a follow-up query over new data returns nothing for the removed selector.

  8. Disable the admin API again

    The administrator removes the --web.enable-admin-api flag, restarts Prometheus, and confirms that the destructive endpoints no longer respond. Close any network or proxy exception opened for the window. Store the final change record with the matchers, backup location, timestamps, and verification results. The step is done when the admin endpoints are refused and the ticket is closed with the evidence attached.

Reclaiming disk after tombstones

On a single Prometheus server, a delete request does not remove samples right away. Prometheus records tombstones that mark the deleted series and time ranges, and the data is physically removed only when compaction rewrites the affected blocks. Until that happens, the disk usage you see may stay flat or even grow, which surprises teams that expect an immediate drop. Space comes back on the host's filesystem only after compaction has rewritten the blocks and the old files are gone.

  • Tombstones first: The delete request writes tombstones into the block directories. Confirm the exact behavior in your version's storage documentation before you plan a disk budget.
  • Compaction decides timing: Cleanup happens during normal compaction, so you cannot schedule the disk recovery directly with the delete call.
  • Check the data directory: Measure the TSDB directory size before and after compaction cycles, not just after the API call returns.
  • Keep headroom: Compaction writes new blocks before it removes old ones, so the disk needs free space during the rewrite.
  • Plan the restart window: Confirm whether any step in your environment requires a restart, and treat that as a change with its own approval.

Before you expect disk to shrink, confirm the cleanup behavior for your Prometheus version and measure the result on a test server with the same retention settings.

Stopping the same series from returning

Deleting a series removes existing data, but nothing stops Prometheus from collecting it again if the source still produces it. Each card below is a path that brings a deleted series back, with the check to run in your own setup before you trust the deletion.

Scrape target still exposes the series

If the application or exporter still publishes the metric with the same labels, the next scrape writes it again within seconds. Deletion only removes what is already stored. Check the target's /metrics output for the series name and labels before running the delete. Fix it at the source by removing or renaming the metric, or by dropping it at scrape time with metric_relabel_configs using a drop action. Confirm the behavior of your exporter version, since some expose metrics conditionally.

Storage docs

Recording rules and remote write re-send it

A recording rule that still references the deleted series will recompute and store its output, and a remote write queue may still hold samples that were sent before the deletion. Review every rule file for the metric name and remove or update the expression. Check whether your remote write endpoint keeps its own copy, because deleting locally does not delete data already shipped to long-term storage. Confirm with your remote storage vendor how it handles deletion requests.

Backup restore reintroduces blocks

Restoring a snapshot or a copy of the data directory taken before the deletion brings the series back as whole blocks. This is easy to miss during a recovery, when the team focuses on getting Prometheus running again. Record the deletion time, compare restored block time ranges against it, and rerun the delete after any restore. Keep a note of deletions in your change log so the restore runbook includes them. Confirm your backup tooling copies the data as expected before you rely on it.

Replica or federated peer still holds it

In a high-availability pair, each Prometheus server scrapes and stores its own copy, so a delete on one server leaves the other holding the series. The same applies to a federation parent that pulls the metric from a child, and to a query layer that merges replicas. Run the delete on every instance that stored the data, and check each federation and query path. Confirm how your scaling layer handles deletion, since the answer differs by tool.

No relabeling rule was added

If the cause is a label you do not want, such as a user identifier or a short-lived pod name, the series will keep appearing until a relabeling rule removes that label or drops the metric. Deleting the old series without adding the rule just starts the cycle again. Write the rule in the scrape configuration, test it against a sample of targets, and confirm the new series names appear in the TSDB status view before closing the change. Ask your team to review the rule alongside the delete request.

Questions teams ask before deleting Prometheus series

Is deleting Prometheus series a task our own team can handle?

Yes, many teams can do it in-house if they have someone comfortable with the Prometheus admin API and TSDB files. The work is small in command terms but carries risk: the delete_series call marks data for removal without freeing disk right away, and a wrong match selector can remove more than intended. Your team needs to decide who runs the deletion, who checks the result, and who owns the follow-up relabeling so the series does not come back. If no one on the team has run this before, plan a rehearsal on a copy of the data first.

What does a series deletion cost, and who pays for what?

The cost is mostly staff time plus any infrastructure used for testing and backups. Prometheus itself is licensed under Apache-2.0 and has no paid edition, so there is no license fee for the deletion work. Internal costs include engineer hours for scoping, the deletion run, verification, and relabeling changes. If you hire a partner, the price follows from a written scope that lists the series, the environment, the backup method and the verification steps. Ask any provider to itemize these parts so you can see what is one-time and what recurs, such as later checks after new releases.

How long does deleting series and reclaiming space take?

Duration depends on how many series match, how much history they span, how large the TSDB is, and how the instance is run. The deletion request itself is short, but disk space is reclaimed only after tombstones are cleaned and the affected blocks are compacted, which takes time on a busy server. Large histories and heavy query load extend the work, as does a need to take a backup first. Ask your provider or team to estimate each phase separately and to state what will be measured to decide the work is done.

What do we need to provide before deletion starts?

You need to provide access to the Prometheus server and its data directory, a tested backup, and a defined maintenance window if the server must be stopped or the admin API enabled for a short period. You also need the exact series selectors, the time range to delete, and the owners who approve the change. Prepare verification queries that show the series are gone and that the metrics you still need remain intact. Confirm your backup approach with the Prometheus storage documentation before changing anything.

Is sensitive data fully gone after deletion?

Not necessarily. Deleting series through the API marks data for removal, and the bytes may remain on disk until tombstones are cleaned and compaction rewrites the blocks. Copies may also exist in snapshots, backups, remote write destinations, or long-term storage systems. Treat the deletion as complete only after you have cleaned tombstones, checked every copy you know about, and confirmed how each backup is retained or expired. Document what was removed and where residual copies were handled, because auditors and data owners will ask.

What stops the same series from coming back?

Deletion removes existing data, but the next scrape will recreate the series if the metric and labels are still exposed by a target. Prevent this by changing the source with relabeling that drops the metric or label, or by fixing the instrumentation. Check the scrape configuration and any remote write or federation paths, since they can reintroduce data. Verify after the next scrape cycles that the series does not reappear, and keep the relabel rule under version control so it survives configuration reloads.

When should we bring in a partner instead of doing it ourselves?

Consider a partner when the deletion involves regulated or sensitive data, a large history across many servers, or a production instance that cannot tolerate mistakes. A partner is also useful when you need documented evidence for an assessment. DeployOpen plans and implements self-hosted open-source platforms in infrastructure you control, prepares evidence for compliance assessments without issuing attestations, and works from a fixed scope agreed in writing before work starts. Ask for the written scope, the verification plan and the retest approach before you decide.

How a deletion moves through Prometheus

The path starts at the relabel rule, because a deletion only holds if the source stops sending the series again. Next, the operator checks the matcher against live series and takes a backup snapshot before anything is removed. The delete_series call works only when the admin API is enabled, and it writes tombstones that mark data for removal. Compaction then rewrites the affected blocks, and disk space comes back only after that step. Remote storage needs its own cleanup. If the series reappears after the disk check, the relabel rule needs fixing.

Deletion path from matcher check through compaction, with a remote storage branch and re-ingestion loop.

How DeployOpen works on this

DeployOpen scopes series deletion as a bounded piece of work on a Prometheus server you control. We first agree which series are in scope, how deletion is authorized, and how the server will be verified afterward, then build the procedure, test it on a copy, and hand over a runbook your team can repeat.

How we scope

  • Inventory the metric names, label matchers and time ranges to delete, and record who approved each one
  • Confirm whether the admin API is enabled only for the cleanup window, and who can switch it on and off
  • Identify where the same series could return, such as scrape configs, exporters and remote write senders
  • Agree in writing the deliverables, the environments covered and the verification steps before work starts

How we build

  • Write and test the delete_series and clean_tombstones sequence against a restored copy of the data directory
  • Add relabeling or metric drop rules at the source so the removed series do not reappear after the next scrape
  • Measure disk usage before and after tombstone cleanup and record the results in the change log
  • Confirm that queries, recording rules and alerts that depended on the removed series still behave as expected

How we hand over

  • Deliver a runbook with exact commands, prerequisites, rollback steps and the order of operations
  • Document the audit trail: the matchers used, the time window, the operator and the approval reference
  • Walk your operations team through a dry run so they can repeat the procedure without DeployOpen present
  • Leave a checklist for recognizing returning series, including how to check the TSDB status API for them

How we support

  • Offer ongoing support, upgrades and continuous testing as a retainer if your Prometheus estate changes often
  • Retest the admin API restrictions and reverse proxy rules after platform or configuration changes
  • Support future cleanups under the same procedure so each deletion is reviewed, logged and verified
  • Ask for a quote based on the written scope, since DeployOpen does not publish a price list

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.