Thanks for the idea воскресенье, 17 мая 2020 г., 0:24:24 UTC+3 пользователь Matthias Rampke написал: > > If you care about the individual event to the extent that you want to see > it individually, you are probably better off using an event tracking system > like the ELK stack. > > Prometheus shines when you only need to track aggregates, such as the > number of uploads, and the total time of uploads. It can do math to get the > average duration and such from that, but it cannot track "this upload in > particular took that long". From this perspective, the metrics staying > constant when there are no new uploads makes sense: the *total* does not > stop existing just because it did not increase in the last minute. > > > > /MR > > On Sat, May 16, 2020, 19:06 'Albert Aleksandrov' via Prometheus Users < > [email protected] <javascript:>> wrote: > >> One minute later I thought about deleting metrics from registry after >> being scraped >> and registering it back when upload appear. >> >> суббота, 16 мая 2020 г., 19:59:28 UTC+3 пользователь Albert Aleksandrov >> написал: >>> >>> 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. >>> >>> [image: wefwe.jpg] >>> >>> Could you please say how can I archive such behaviour? >>> >>> >>> -- >> 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] <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/prometheus-users/c7870b28-7a40-417d-9b74-d6c2b48390b4%40googlegroups.com >> >> <https://groups.google.com/d/msgid/prometheus-users/c7870b28-7a40-417d-9b74-d6c2b48390b4%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> >
-- 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/d33dc8f2-d8cd-4529-805d-a8ba031a53cf%40googlegroups.com.

