how to delete label values in prometheus 2.0 ?

2,721 views
Skip to first unread message

dara...@gmail.com

unread,
Jan 7, 2018, 10:00:32 PM1/7/18
to Prometheus Users
hi all,

I have tried to send post request to:

/api/v2/admin/tsdb/delete_series
and
/api/v2/admin/tsdb/clean_tombstones
 
but it is not work.

How to delete label values in prometheus 2.0 ?

d.sh...@anchorfree.com

unread,
Apr 4, 2018, 5:25:16 PM4/4/18
to Prometheus Users
Hi all,
I am also looking for this.
A call to "/api/v2/admin/tsdb/delete_series" deletes the "data" of metric but not the series itself,
I created a lot of values in a loop (instead using tags, just learning Prometheus..)  and need to delete them,
but I am able only deleting their data and not cleanup the metric itself.  I have a huge list of metrics I don't need now :(  .

Julius Volz

unread,
Apr 5, 2018, 6:52:38 AM4/5/18
to d.sh...@anchorfree.com, Prometheus Users, Goutham Veeramachaneni
I can confirm... even after deleting the tombstones, a deleted metric still shows up under http://localhost:9090/api/v1/label/__name__/values.

+cc Goutham

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/c6ec1303-325c-4d6a-9e80-7f12ff152cce%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Brian Brazil

unread,
Apr 5, 2018, 6:53:43 AM4/5/18
to Julius Volz, d.sh...@anchorfree.com, Prometheus Users, Goutham Veeramachaneni
On 5 April 2018 at 11:52, Julius Volz <juliu...@gmail.com> wrote:
I can confirm... even after deleting the tombstones, a deleted metric still shows up under http://localhost:9090/api/v1/label/__name__/values.

This is known, the index can always return false positives and it gets cleared up at the next compaction mostly.

Brian
 

For more options, visit https://groups.google.com/d/optout.



--

Julius Volz

unread,
Apr 5, 2018, 6:54:42 AM4/5/18
to Brian Brazil, d.sh...@anchorfree.com, Prometheus Users, Goutham Veeramachaneni
On Thu, Apr 5, 2018 at 12:53 PM, Brian Brazil <brian....@robustperception.io> wrote:
On 5 April 2018 at 11:52, Julius Volz <juliu...@gmail.com> wrote:
I can confirm... even after deleting the tombstones, a deleted metric still shows up under http://localhost:9090/api/v1/label/__name__/values.

This is known, the index can always return false positives and it gets cleared up at the next compaction mostly.

Hmm, so if a block is already at its maximum compaction, I guess the old index data will never be expunged (except by retention)?

Brian Brazil

unread,
Apr 5, 2018, 7:04:43 AM4/5/18
to Julius Volz, d.sh...@anchorfree.com, Prometheus Users, Goutham Veeramachaneni
On 5 April 2018 at 11:54, Julius Volz <juliu...@gmail.com> wrote:

On Thu, Apr 5, 2018 at 12:53 PM, Brian Brazil <brian.brazil@robustperception.io> wrote:
On 5 April 2018 at 11:52, Julius Volz <juliu...@gmail.com> wrote:
I can confirm... even after deleting the tombstones, a deleted metric still shows up under http://localhost:9090/api/v1/label/__name__/values.

This is known, the index can always return false positives and it gets cleared up at the next compaction mostly.

Hmm, so if a block is already at its maximum compaction, I guess the old index data will never be expunged (except by retention)?

You can do a clean tombstones on it.

Brian



--

Julius Volz

unread,
Apr 5, 2018, 8:03:26 AM4/5/18
to Brian Brazil, d.sh...@anchorfree.com, Prometheus Users, Goutham Veeramachaneni
On Thu, Apr 5, 2018 at 1:04 PM, Brian Brazil <brian....@robustperception.io> wrote:
On 5 April 2018 at 11:54, Julius Volz <juliu...@gmail.com> wrote:
On Thu, Apr 5, 2018 at 12:53 PM, Brian Brazil <brian.brazil@robustperception.io> wrote:
On 5 April 2018 at 11:52, Julius Volz <juliu...@gmail.com> wrote:
I can confirm... even after deleting the tombstones, a deleted metric still shows up under http://localhost:9090/api/v1/label/__name__/values.

This is known, the index can always return false positives and it gets cleared up at the next compaction mostly.

Hmm, so if a block is already at its maximum compaction, I guess the old index data will never be expunged (except by retention)?

You can do a clean tombstones on it.

As I and others mentioned here, that doesn't seem to result in the removal of the stale index entries.

Goutham Veeramachaneni

unread,
Apr 5, 2018, 8:10:39 AM4/5/18
to Prometheus Users
Hi,

https://github.com/prometheus/prometheus/issues/3728 tracks this. `clean_tombstones` doesn't clean those labels that are in HEAD block. There is a PR to fix it, but I'm holding off until I get isolation in: https://github.com/prometheus/tsdb/pull/270 Should make 2.3.

Thanks,
Goutham.

On Thursday, April 5, 2018 at 5:33:26 PM UTC+5:30, Julius Volz wrote:
On Thu, Apr 5, 2018 at 1:04 PM, Brian Brazil <brian....@robustperception.io> wrote:
On 5 April 2018 at 11:54, Julius Volz <juliu...@gmail.com> wrote:
Brian
 
 
Brian
 

+cc Goutham

To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To post to this group, send email to promethe...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To post to this group, send email to promethe...@googlegroups.com.



--




--

Julius Volz

unread,
Apr 5, 2018, 8:50:07 AM4/5/18
to Goutham Veeramachaneni, Prometheus Users
Ah, thanks for the info Goutham! Makes sense.

To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/7df00927-a54d-49c3-a73e-1952b95d1dc1%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages