Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question]: Delete metrics for a specific target #2356

Closed
DigitalMarc opened this Issue Jan 20, 2017 · 6 comments

Comments

Projects
None yet
4 participants
@DigitalMarc
Copy link

DigitalMarc commented Jan 20, 2017

Hi,
Prom version: 1.2.1

It seems that we can't use the delete API to remove a set of metrics such as:
{__name__=~".*",cluster="Test Cluster"}
The API reply with 400 Bad Request

full request made: curl -X DELETE -g 'http://localhost:9090/api/v1/series?match[]={__name__=~".*",cluster="Test Cluster"}'

How can we remove all the metrics that matches a specific field or, put differently, all metrics from a target?

Many thanks

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Jan 20, 2017

That looks to be correct. Does that expression work in the expression browser?

@DigitalMarc

This comment has been minimized.

Copy link
Author

DigitalMarc commented Jan 20, 2017

Yes it does.

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Jan 20, 2017

The space needs to be encoded as %20

@DigitalMarc

This comment has been minimized.

Copy link
Author

DigitalMarc commented Jan 20, 2017

Wonderful!

@piotrkochan

This comment has been minimized.

Copy link

piotrkochan commented Oct 18, 2018

curl -X DELETE -g 'localhost:9090/prometheus/api/v1/series?match[]={instance="localhost:9100"}' | jq
{
  "status": "error",
  "errorType": "internal",
  "error": "not implemented"
}
@mzupan

This comment has been minimized.

Copy link

mzupan commented Nov 2, 2018

@piotrkochan

curl -X POST localhost:9090/api/v1/admin/tsdb/delete_series?match[]={instance="localhost:9011"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.