Delete existing metrics

6,895 views
Skip to first unread message

dumas...@gmail.com

unread,
Mar 23, 2016, 12:10:20 PM3/23/16
to Prometheus Developers
Hello everyone,

I plugged the JMX exporter to my HBase instance without seeing there were JMX metrics relative to regions.

I blacklisted them afterwards but now I am stuck with hundreds of useless metrics polluting the database and the Prometheus interface.

Has anyone a solution to delete quickly all of them ? Is there a way to delete an entire job for example ?

Thanks,
Simon

Julius Volz

unread,
Mar 23, 2016, 12:12:32 PM3/23/16
to dumas...@gmail.com, Prometheus Developers


--
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-devel...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

dumas...@gmail.com

unread,
Mar 23, 2016, 12:20:52 PM3/23/16
to Prometheus Developers, dumas...@gmail.com
Thanks.

Do you know if there is a way to retrieve all series for a given job ?
So that I can create a script to delete all of them ?

Fabian Reinartz

unread,
Mar 23, 2016, 12:23:21 PM3/23/16
to dumas...@gmail.com, Prometheus Developers
Yes, you can just leave out the metric name in your query.
For example:

$ curl -XDELETE -g 'http://localhost:9090/api/v1/series?match[]={job="prometheus"}'

Brian Brazil

unread,
Mar 23, 2016, 12:23:32 PM3/23/16
to dumas...@gmail.com, Prometheus Developers
On 23 March 2016 at 16:20, <dumas...@gmail.com> wrote:
Thanks.

Do you know if there is a way to retrieve all series for a given job ?
So that I can create a script to delete all of them ?

No need, you delete based on selector so {job="myjob"} is what you want.

Brian
 

On Wednesday, March 23, 2016 at 5:12:32 PM UTC+1, Julius Volz wrote:
> Yep, see http://prometheus.io/docs/querying/api/#deleting-series
>
>
> On Wed, Mar 23, 2016 at 5:10 PM,  <dumas...@gmail.com> wrote:
> Hello everyone,
>
>
>
> I plugged the JMX exporter to my HBase instance without seeing there were JMX metrics relative to regions.
>
>
>
> I blacklisted them afterwards but now I am stuck with hundreds of useless metrics polluting the database and the Prometheus interface.
>
>
>
> Has anyone a solution to delete quickly all of them ? Is there a way to delete an entire job for example ?
>
>
>
> Thanks,
>
> Simon
>
>
>
> --
>
> You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
>
> To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-devel...@googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-devel...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

dumas...@gmail.com

unread,
Mar 23, 2016, 12:35:46 PM3/23/16
to Prometheus Developers, dumas...@gmail.com
Ok, I misunderstood the use of the selector.

It worked, my Prometheus instance is now free from these metrics.

Thanks everyone for the quick answers.

wyu...@gmail.com

unread,
Mar 25, 2016, 1:38:25 AM3/25/16
to Prometheus Developers, dumas...@gmail.com
If prometheus_cli has the feature to operate(for example, delete) metrics, I think that it is useful.

https://github.com/prometheus/prometheus_cli/issues/13

Thanks,
Wataru Yukawa

2016年3月24日木曜日 1時35分46秒 UTC+9 dumas...@gmail.com:

Fabian Reinartz

unread,
Mar 25, 2016, 9:49:39 AM3/25/16
to wyu...@gmail.com, Prometheus Developers, dumas...@gmail.com
Having a reasonably coverage of API features in a CLI tool is very reasonable.
However, prometheus_cli is at point of deprecation I would say.

Either this functionality could live in promtool (Prometheus main repo) or by an overhaul of prometheus_cli.
I actually started writing a Go API client a while ago (https://godoc.org/github.com/prometheus/client_golang/api/prometheus) but the need was quite limited so it only supports querying. It can easily be extended by the remaining API functionality.

I'll gladly to support anyone who wants to give this a go.

wyu...@gmail.com

unread,
Mar 26, 2016, 8:50:26 AM3/26/16
to Prometheus Developers, wyu...@gmail.com, dumas...@gmail.com
hmm, I didn't notice promtool.

I'll check it out.

Thanks

2016年3月25日金曜日 22時49分39秒 UTC+9 Fabian Reinartz:
Reply all
Reply to author
Forward
0 new messages