Grafana Cloud

Manage metrics query costs

Grafana Cloud Metrics pricing includes a fair use query allowance. Each month, your stack includes 20 billion metrics query units (MQU) for every 1,000 billable series, and only query volume above that allowance is billed. Most customers stay within the allowance. If you exceed it, you’re charged for the additional query usage.

For how MQU are counted and how the allowance is calculated, refer to Metrics pricing.

Query volume is driven by how many samples your queries read. A query reads more samples when it selects more series, covers a longer time range, or runs more often. The recommendations in this guide target the patterns that most commonly push query usage above the allowance.

Recommendations

Every recommendation in this section reduces the number of samples your queries read. Because each sample read counts toward your MQU, and because the fair use allowance is fixed by the series you send, the aspects you control on the query side are how much data each query reads and how often it runs. The three areas below cover the query sources that most often account for the bulk of a stack’s query volume:

  • rules, because they run around the clock.
  • dashboards, because they refresh repeatedly for every viewer.
  • Explore, API, and agent queries, because they tend to scan broad ranges with few label matchers.

Review alert and recording rules

Alert and recording rules are the most common source of excess query volume because they run continuously. A rule that scans a long window on every evaluation re-reads that whole window each time it runs. For example, a rule that compares current throughput to a seven day baseline and evaluates every minute, reads seven days of samples 60 times an hour.

For rules that look back over long time ranges:

  • Move the expensive part of the expression into a recording rule, and have the alert rule read the precomputed result. Evaluate the recording rule at a cadence that matches how often the baseline actually changes, such as every 30 or 60 minutes, rather than on every alert evaluation.
  • Match the query range to the evaluation interval where you can. A rule that evaluates every minute rarely needs more than a few minutes of data.
  • Check for rules that return errors on every evaluation. A failing rule still reads samples each time it runs.

Note

This applies to both Grafana-managed rules under Alerts & IRM > Alerting and rules you upload to Mimir with mimirtool.

Optimize auto-refreshing dashboards

Dashboards that refresh automatically read the full time range on every refresh, for every panel.

  • Set the default time range to what people actually need. Use a shorter range for day to day views and let people widen it when they need to.
  • Turn off auto-refresh for dashboards that don’t need real-time data, or choose a longer refresh interval.
  • Use $__rate_interval rather than a fixed, long range in rate() and similar functions.
  • Aggregate high cardinality metrics with recording rules and query the aggregated series.

Scope Explore, API, and agent queries

Queries from Explore, the API, and AI agents that use the Grafana MCP server can read very large volumes when they search broad time ranges without specific label matchers.

  • Start with a narrow time window and widen it only if the result is empty.
  • Always include the most specific label you have, such as job or instance, instead of relying on a broad selector like cluster or namespace over a multi-day window.
  • If the same investigation runs repeatedly, convert it into a recording rule so repeat runs read a precomputed series instead of scanning the raw data again.

View your query usage

  1. In your Grafana Cloud stack, go to Cost Management and Billing > Usage.
  2. Under Product Breakdown, select Metrics.

The Metrics view shows your query usage in MQU against the fair use allowance for the billing period. You can also query the grafanacloud-usage data source directly. grafanacloud_instance_metrics_query_unadjusted_usage is your total query usage in MQU, including usage within the allowance, and grafanacloud_instance_metrics_query_usage is the billable usage above it. For more details, refer to Understand Metrics usage and cost.