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