Alert with "this month so far" range

Trying to setup an alert for Grafana Cloud billing, “Total additional usage” and thing is I can’t choose the start of this month relatively, like in “this month” in the dashboard itself.

Any way maybe to overcome this or accomplish in a different matter? Thanks.

Alert rules cannot be set for relative time such as from: now/M , to: now (“This month so far”). However all the metrics that make up the “Total additional usage” query (grafanacloud_org_metrics_overage + grafanacloud_org_logs_overage + grafanacloud_org_traces_overage + grafanacloud_org_grafana_overage) in the Grafana Cloud Billing/Usage dashboard already calculate an output based on the 95th percentile of this month so far which comes from the datasource grafanacloud-usage that’s part of your Grafana.

Therefore the output of the “Total additional usage” query from that data source, set to the shortest interval of the last 5 minutes (from: now-5m to: now) will suffice to always give you the output for those projected $ overages for the month so far. The alert rule will then check the threshold that you set against that consistent monthly calculation.

In short, set the time interval to the 5 minutes and it will work.

1 Like