Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deleting metrics from Prometheus produces error: not implemented

Tags:

prometheus

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>]}
like image 977
rookie09 Avatar asked Jan 30 '23 07:01

rookie09


1 Answers

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"}]}'
like image 125
brian-brazil Avatar answered May 17 '23 08:05

brian-brazil