Hi all!
(Django app)
We have a business entity called upload. It has such parameters (labels) as
1. series (series1, series2, etc),
2. processing_duration (in seconds),
3. status (success, running, terminated),
4. some another labels.
With Prometheus we would like to count:
1. uploads summed by status,
2. average duration by series,
3. something else.
Now I see metrics to look like this to archive our goals:
upload{series="series1", status="terminated"} 1 # actually the value is always 1
upload{series="series2", status="terminated"} 1
upload{series="series2", status="success"} 1
upload_processing_duration{series="series1"} 20
upload_processing_duration{series="series2"} 30
With such metrics queries would be like this:
sum(upload{status="terminated"}) or sum(upload{series="series1"})
avg(upload_duration{series="series1"})
So as to have such raw (plain, atomic) data in Prometheus one should to push
them as they appear or to save them by one (without overriding) if we use /metrics
endpoint which then is being scraped by Prometheus with some interval.
I tried pushgateway but when metrics pushed they stay there with the same values
until overriding or deleting. And it happens that Prometheus scrapes the same values again
and again instead of to scrape them and forget delete.

Could you please say how can I archive such behaviour?