> Should it not stop relaying the same data to sysdig once it has sent it 
successfully?

No, because it's not the same data.  Each scrape creates a new data point:
- The value of this metric was V at time T1
- The value of this metric was V at time T2
- The value of this metric was V at time T3
... etc

Those are different pieces of information.

Pushgateway is not a "relay" as such.  It is more of a cache, just storing 
the last-written value.

The model of Prometheus is:
- data is fetched via scraping
- you can have multiple Prometheus instances scraping the same exporters 
(e.g. for high availability, or so you can run a development instance on 
your laptop)

Therefore it would not be possible for pushgateway to delete a value once 
it has been scraped; that would stop a second Prometheus instance from 
seeing the same data.

But there are other reasons why this is a bad idea.  One of them is that 
any timeseries which has not had a write within the last 5 minutes is 
considered "stale", i.e. it has no current data.  If you ask the value of a 
metric at a given instant, Prometheus only looks 5 minutes into the past.  
So if the value of a metric is V, then you need to record the value 
repeatedly to be able to see that its current value is still V.  There is a 
difference between knowing the value of something is the same as it was 
before, and not knowing its value at all.

> So how do I prevent Prometheus from  relaying the same data

You would need to let the timeseries become stale - i.e. "no data" rather 
than "same data as last time".  You can't do that with pushgateway: see 
https://github.com/prometheus/pushgateway#non-goals

The solution is to get rid of pushgateway, and write a proper exporter for 
your data: one which is scraped directly, and returns a list of all the 
current values of a metric.  If a metric no longer exists, then you can 
stop returning it, and it will become stale.  But as I said before, "a 
metric no longer exists" is different to "the metric still exists, but 
happens to have the same value as last time you saw it".

If you describe what your metric is and what it represents, people may be 
able to help you more.

If you are only using pushgateway because the source cannot be scraped 
directly (e.g. because of firewall restrictions), then there are other 
options, e.g. PushProx <https://github.com/prometheus-community/PushProx>.

>

-- 
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/81a57343-8f6c-48b6-9e27-9954718936ffo%40googlegroups.com.

Reply via email to