On Saturday, 31 October 2020 05:01:48 UTC, dmitry b wrote: > > This proposal is slightly different: [optionally] remove the metric when > it's been read (probably by Prometheus) >
I am sure that won't happen, as it completely breaks the Prometheus data collection model. For example: a HA prometheus has two prometheus servers scraping the same endpoint. A development environment running on a laptop may scrape the same endpoints as your production environment. Scraping a value should not interfere with another system's scrape. > My use case and seemingly many other people's call for it. > As it is, I have to jump through hoops to works around the issue of metric > still showing as current in Prometheus long after it's been pushed to PG The metric either carries true information, or it does not. The metric might say: "the last execution of job X had status code Y". That metric carries a true piece of information. If you don't re-run job X, then it remains true indefinitely. If you are worried that job X last ran a long time ago, then you expose a new metric which carries the *time* at which job X last ran. That's also true indefinitely, until the next time that job X runs. In short: it sounds like you are mis-using pushgateway (and prometheus itself). Prometheus is not an event-logging system; something like loki would be more suitable for that. Prometheus carries timeseries, that is, numeric data which evolves over time, where each data point relates to the point before it. Pushgateway is *only* for cases where: - you run a particular job repeatedly, AND - the job is a "one-shot", i.e. it runs then terminates, AND - the job needs somewhere to stash its result so it can be scraped after it has terminated. That's it. There's no other use case for pushgateway. I think it has a bad name; it should be called "cached_result_exporter" or something like that. -- 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/1949c1f4-5df3-49ca-9487-d2872dab2bdeo%40googlegroups.com.

