Calculating rate() per-minute, not per-second

19,863 views
Skip to first unread message

Dave Cadwallader

unread,
Nov 14, 2017, 1:18:27 PM11/14/17
to Prometheus Users
I just set up cloudwatch_exporter and I want to track my AWS API usage.

From the cloudwatch_exporter docs:

If you have 100 API requests every minute, with the price of USD$10 per million requests (as of Jan 2015), that is around $45 per month. The cloudwatch_requests_total counter tracks how many requests are being made.

I'm plotting rate(cloudwatch_requests_total) in grafana, and it's giving me a LOT of data points about the per-second rate.  But I'm looking for per-minute, not per-second.

How can I structure this query to give me only "cloudwatch requests per minute" (and to only return per-minute resolution in the results to ease the query and data load)

Thanks!

Ben Kochie

unread,
Nov 14, 2017, 4:35:29 PM11/14/17
to Dave Cadwallader, Prometheus Users
This will give you the minute rate averaged over 5 minutes.

rate(cloudwatch_requests_total[5m]) * 60

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/668eecf6-73c3-484d-a7b8-4348a5b9fd77%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages