Hello, can someone please help me to understand why "max_over_time" ist not working as I expect it to work?
Why do I see a correct peak using max_over_time(metric{}[1h:15s]) but if I run this command the peak is lower than with the other command before? max_over_time(metric{}[24h:15s]) PS: [15s:15s] from the first post was wrong - I used 1h:15s and wanted to clarify that the selected steps match the scrape interval. Regards Alexander Wilke schrieb am Mittwoch, 28. August 2024 um 21:36:48 UTC+2: > Hello, > > I have some metrics of network devices. I want to know the highest values > of these metrics in the last X hours which was higher than a specific > threshold. > > Ideally I would like to see the value and the timestamp. Sometimes I would > like to see the highest value of the last 24hrs and sometimes the highest > three values of the last 24hrs or the last month or year. > > I would like to see this in a table. > > I tried something lke that from node exporter in Grafana > > topk(3, > max_over_time(node_disk_io_now{device=~"dm-0", instance="ubiquiti", > job="node_exporter"}[15s:15s]) > 10 > ) > > > However first problem if the max value is e.g. 22 and it appears several > times within the timerange I see this displayxed several times. I would > like to idealle see the most recent ones - thats why I though "topk(3,)" > would help but it does not seem to work as I would expect. > > second thing is that if I run this query over a timerange of 3hrs I get > really the maximum values. If I use a timerange of 3days or 3 weeks then I > do get different values and the peaks which should appear do not appear > anymore. Why is max_over_time not displaying these values anymore? I used > [15s:15s] because my scrape_interval is 15s. > > another thing is I do not know how to get the timestamp of the last > occurence > > > Would really appreciate any help why "max_over_time" is not working as I > expect it to work and how to optimize the query to answer my questions. > > -- 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 prometheus-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/a1885ae5-5518-4635-b5e3-5d4e64321242n%40googlegroups.com.