capabilities.work

Purge a Retired Job's Pushed Metrics

A 3-step recipe with Prometheus. We can help you get access.

Recipe · 3 steps

Purge a Retired Job's Pushed Metrics

Delete every metric for a retired job after confirming the group is stale.

  1. List every stored metric group and read the labels and last push time. A lastPushedAt far in the past is the evidence that this group belongs to a job that no longer runs rather than one that runs rarely.
  2. Delete every metric stored under this job label. Prometheus stops seeing the job's series on its next scrape of the Pushgateway.
  3. Read the stored groups back and confirm the retired job's group is no longer among them.
What you'll need to have ready
  • jobName: The job label of the retired job whose metrics should be purged (e.g. legacy-nightly-export).
For your developer

Arazzo workflow prometheus:purge-retired-job-metrics, 3 operations: listAllMetrics → deleteJobMetrics → listAllMetrics. Specs on APIs.io.