A variant that I could use - in lack of better - would be to delete all metrics from Python
Den ons. 18. nov. 2020 kl. 11.46 skrev Peter Toft <[email protected]>: > I have a case where I probably have to push say 200 metrics from Python to > a pushgateway->prometheus->grafana system - it rocks, > However the 200 metrics might later be reduced to 170 metrics, where at > that point I need to query the pushgateway for the obtained metrics - and > delete the 30 ones that we did not want any more. They day after it might > be 10 that I need to remove. And add a few others. > I can manually go to the pushgateway and press "Delete Group" at > http://localhost:9091/# - it works, but I really like to > > - automate > - handling done from Python > > Anyone who has examples for the following - preferably within Python > > - Obtain a Python list or dict of metrics -> "my_metrics" > - Query the pushgateway for the known metrics -> "pg_metrics" > - Traverse the "pg_metrics" and delete the metrics that are not in > "my_metrics" > > There are discussions on something similar e.g. in > > https://www.metricfire.com/blog/prometheus-pushgateways-everything-you-need-to-know/ > prometheus/pushgateway#77 > <https://github.com/prometheus/pushgateway/issues/77> > > -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/prometheus-users/9208f69f-095f-481c-9110-6c7c3a34da61n%40googlegroups.com > <https://groups.google.com/d/msgid/prometheus-users/9208f69f-095f-481c-9110-6c7c3a34da61n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- Peter Toft <[email protected]> -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/CAAW%2Bni836Ab_F7tf5AhAmjVNR5CeRt9DgvLRMR073ZMmVFFq1A%40mail.gmail.com.

