I would like to delete all metrics for a time series mymetricname{foo="bar"}
in a Prometheus 2.0.0-beta.2 installation.
I currently get an error message from this call to the HTTP API:
curl -X DELETE -g \
'http://localhost:9090/api/v1/series?match[]=mymetricname{foo="bar"}'
{"status":"error","errorType":"internal","error":"not implemented"}
But then a statement from the author apparently suggests that this type of call became possible a long time ago (back in 2015). What is going on here?
UPDATE It seems unlikely that the problem is due to ill-escaped letters in the URL, because the following works just fine:
curl -X GET -g \
'http://localhost:9090/api/v1/series?match[]=mymetricname{foo="bar"}'
{"status":"success","data":[<data>]}
In Prometheus 2.0 the endpoint has moved to a POST with a body on /api/v2/admin/tsdb/delete_series
For example:
curl -XPOST -g 'http://localhost:9090/api/v2/admin/tsdb/delete_series' -d '{"matchers": [{"name": "__name__", "value": "up"}]}'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With