How can I delete old Jobs from Prometheus?

i have 2 jobs. One is new, the other is old.

I need to delete the old one, so that it gets removed from Grafana dashboard too.

i try to delete the old job with the exact command would be something like:

curl -X POST -g 'http://localhost:9090/api/v1/admin/tsdb/delete_series?match[]={job="name_of_old_job"}'

Replace name_of_old_job with the name of the job you want deleted.

but it dosen’t work → 404

run this in order to get a list of all prometheus jobs that i have:

curl http://localhost:9090/api/v1/label/job/values

but it dosen’t work → 404

with FQDN and exact Url Path:
curl -X POST -g ‘http://**FQDN/prometheus/api/v1/admin/tsdb/delete_series?match={job=“name_of_old_job”}’

301 Moved Permanently

301 Moved Permanently


nginx

have somebody an idee?

Try curl -L -X POST -g https://**FQDN**/prometheus/api/v1/admin/tsdb/delete_series?match={job="name_of_old_job"}

I only managed to reach Prometheus with the FQDN and HTTPS. -L allows curl to follow the 301 redirection made by the SSO. Add -k to allow self-signed certificates.

curl http://bottle.local/prometheus/api/v1/label/job/values -Lk
{"status":"success","data":["prometheus"]}

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.