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/6d38d3b4-3f12-4873-9f75-6eeabc58e35an%40googlegroups.com.

Reply via email to