Hi,
I'm looking for a way to query Prometheus for total bytes transferred in a given pay period (typically, the current month). This would be connected to a Grafana graph displaying the usage -- it would be increasing each month, and then reset when the next month begins, etc. The measurements come from node_exporter's node_network_transmit_bytes metrics (a counter of bytes transferred).
My problem is that I'm not exactly sure how to write the query that will give me the utilization in the _current_ month, rather than in the trailing 30 days? I can observe the utilization over the trailing 30 days with a query such as:
increase(node_network_transmit_bytes{device="eth0"}[30d])
But how would I write a query for "increase over the current month" (month of the time the expression is evaluated)? Or over a different time period (say, week, or day)?
I'm rather new PromQL, so I apologize if I'm asking an obvious question. I did try to google for the answer, but wasn't very successful.
PS: Given this is my first post here, I also want to thank you for writing and making Prometheus available! We're deploying it as a part of a system that monitors the sky for
astronomical transient events (from new asteroids to supernovae).
Regards,
-- Mario