iso123
iso123

Reputation: 89

Deleting labels in Prometheus

I'm using Prometheus to do some monitoring but I can't seem to find a way to delete labels I no longer want. I tried using the DELETE /api/v1/series endpoint but it doesn't remove it from the dropdown list on the main Prometheus Graph page. Is there a way to remove them from the dropdown without restarting from scratch?

Thanks

Upvotes: 1

Views: 14297

Answers (3)

valyala
valyala

Reputation: 17784

Prometheus doesn't provide the ability to delete particular labels, because this may result to duplicate time series with identical labelsets. For example, suppose Prometheus contains the following time series:

http_requests_total{instance="host1",job="foobar"}
http_requests_total{instance="host2",job="foobar"}

If instance label is removed, then these two time series will become identical:

http_requests_total{job="foobar"}
http_requests_total{job="foobar"}

Now neither Prometheus nor user can differentiate these two time series.

Prometheus provides only the API for deleting time series matching the given series selector - see these docs for details.

Upvotes: 1

Vũ Tô
Vũ Tô

Reputation: 506

This happens to me also, try to include the metric name when querying for labels' values like this:

    label_values(node_load1, instance)

ref: http://docs.grafana.org/features/datasources/prometheus/

Upvotes: 1

brian-brazil
brian-brazil

Reputation: 34112

If you delete every relevant timeseries then it should no longer be returned. If this is not the case, please file a bug.

Upvotes: 0

Related Questions