how to delete series on certain period on Prometheus

4,689 views
Skip to first unread message

maple.f...@hotmail.com

unread,
Nov 14, 2017, 2:26:33 AM11/14/17
to Prometheus Users
Hi,

May I ask if Prometheus API support to delete series on certain period? like data with label job=xxx on last three hours. 

I found related API on https://github.com/prometheus/prometheus/pull/3425/files, but it seems that the API will be migrated to new version. But anyway I still can't find where to set time period on this API of delete action by glimpsing patch, so I wonder if I overlook something. Anyone can help answer that?

best regards.

Ben Kochie

unread,
Nov 14, 2017, 2:53:30 AM11/14/17
to maple.f...@hotmail.com, Prometheus Users
Deleting series for time ranges is not supported.  Only the full series delete is supported.

--
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/2ac181e8-19fd-4e68-8f71-3b36edb67b48%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

maple.f...@hotmail.com

unread,
Nov 14, 2017, 2:56:10 AM11/14/17
to Prometheus Users
Hi,

Thanks for your reply, do you know there is a plan to implement this function or not?

best regards.


On Tuesday, November 14, 2017 at 3:53:30 PM UTC+8, Ben Kochie wrote:
Deleting series for time ranges is not supported.  Only the full series delete is supported.
On Tue, Nov 14, 2017 at 8:26 AM, <maple.f...@hotmail.com> wrote:
Hi,

May I ask if Prometheus API support to delete series on certain period? like data with label job=xxx on last three hours. 

I found related API on https://github.com/prometheus/prometheus/pull/3425/files, but it seems that the API will be migrated to new version. But anyway I still can't find where to set time period on this API of delete action by glimpsing patch, so I wonder if I overlook something. Anyone can help answer that?

best regards.

--
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.

Ben Kochie

unread,
Nov 14, 2017, 3:06:19 AM11/14/17
to maple.f...@hotmail.com, Prometheus Users
I don't think so, but you could file a feature request here:


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/74bc0986-29fa-4385-bc36-8b8c66778932%40googlegroups.com.

maple.f...@hotmail.com

unread,
Nov 14, 2017, 5:50:38 AM11/14/17
to Prometheus Users
Hi Ben,

thanks very much!
 
best regards.

On Tuesday, November 14, 2017 at 4:06:19 PM UTC+8, Ben Kochie wrote:
I don't think so, but you could file a feature request here:

On Tue, Nov 14, 2017 at 8:56 AM, <maple.f...@hotmail.com> wrote:
Hi,

Thanks for your reply, do you know there is a plan to implement this function or not?

best regards.

On Tuesday, November 14, 2017 at 3:53:30 PM UTC+8, Ben Kochie wrote:
Deleting series for time ranges is not supported.  Only the full series delete is supported.

On Tue, Nov 14, 2017 at 8:26 AM, <maple.f...@hotmail.com> wrote:
Hi,

May I ask if Prometheus API support to delete series on certain period? like data with label job=xxx on last three hours. 

I found related API on https://github.com/prometheus/prometheus/pull/3425/files, but it seems that the API will be migrated to new version. But anyway I still can't find where to set time period on this API of delete action by glimpsing patch, so I wonder if I overlook something. Anyone can help answer that?

best regards.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/2ac181e8-19fd-4e68-8f71-3b36edb67b48%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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.

Goutham Veeramachaneni

unread,
Nov 14, 2017, 7:42:06 PM11/14/17
to Prometheus Users
Hi,

Prometheus 2.0 has support for granular deletes :) Enable the admin API via: `./prometheus --web.enable-admin-api` and then send a POST request to:

`/api/v2/admin/tsdb/delete_series`, with the body of the format:

```
{
"min_time": "2017-11-15T00:0:0+00:00",
"max_time": "2017-11-15T00:37:20+00:00",
"matchers": [{
"type": "EQ",
"name": "job",
"value": "prometheus"
}]
}
```

The API will documented in a few days, sorry for the confusion.

Thanks,
Goutham.

robu...@gmail.com

unread,
Nov 22, 2017, 11:38:57 AM11/22/17
to Prometheus Users
hi Goutham,

when you do the docu could you please include some examples on how one would:
1.) erase ALL occurrences of a metric 
   like I have:
   zpool_capacity_percent{instance="host.na.me:9100",job="node",zpool="zpool_host"}
   and like to erase ALL "zpool_capacity_percent" timeseries across ALL instances and ALL zpools

2.) erase all "zpool_capacity_percent" for only label="<labelname>"

and: are there regex's allowed?

TIA

best regards
Reply all
Reply to author
Forward
0 new messages