Delete Metrics From PushGateway

786 views
Skip to first unread message

Alan Tam CA

unread,
Jul 9, 2022, 8:18:07 AM7/9/22
to Prometheus Users
Hello,

The PushGateway docs state the following:

Delete all metrics in the group identified by {job="some_job"} (note that this does not include metrics in the {job="some_job",instance="some_instance"} group from the previous example, even if those metrics have the same job label):


I am wondering if there is a way to match all values of the instance label using regex in the URL. So something like

Note: Prometheus has this feature to match all values of a label using ~".+". For instance: 

Bjoern Rabenstein

unread,
Jul 21, 2022, 12:27:20 PM7/21/22
to Alan Tam CA, Prometheus Users
On 08.07.22 18:14, 'Alan Tam CA' via Prometheus Users wrote:
>
> I am wondering if there is a way to match all values of the instance label
> using regex in the URL. So something like
>
> - curl -X DELETE
> http://pushgateway.example.org:9091/metrics/job/some_job/instance/~".+"
>
> Note: Prometheus has this feature to match all values of a label using ~".+".
> For instance:
>
> curl -X POST -g
> 'http://prometheus.example.org:9090/api/v1/admin/tsdb/delete_series?match[]={__name__=~".+"}'

No, that's not possible.

The Pushgateway isn't really a database (like Prometheus itself), so
it doesn't have any fancy matching.

--
Björn Rabenstein
[PGP-ID] 0x851C3DA17D748D03
[email] bjo...@rabenste.in
Reply all
Reply to author
Forward
0 new messages