Avg of count of a metric.

22 views
Skip to first unread message

vineka s

unread,
Sep 1, 2020, 3:27:27 PM9/1/20
to Prometheus Users
Hi ,
Is there any way we can get the avg of the count of a metric for a period of time.?

Thanks!

Matthias Rampke

unread,
Sep 3, 2020, 2:56:04 AM9/3/20
to vineka s, Prometheus Users
Yes, you can combine subqueries, the count aggregator, and the avg_over_time function like so:

avg_over_time(count(kube_pod_info)[10m:])

/MR

--
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-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/dce6117b-c7d7-4222-aeb7-9b06383fb308o%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages