Menu
This is documentation for the next version of Mimir. For the latest stable release, go to the latest version.
Open source
Configure queries to block
In certain situations, you might want to control what queries are being sent to your Mimir installation. These queries might be intentionally or unintentionally expensive to run, and they might affect the overall stability or cost of running your service.
You can block queries using per-tenant overrides:
yaml
overrides:
"tenant-id":
blocked_queries:
# block this query exactly
- pattern: 'sum(rate(node_cpu_seconds_total{env="prod"}[1m]))'
# block any query matching this regex pattern
- pattern: '.*env="prod".*'
regex: true
To set up runtime overrides, refer to runtime configuration.
Note: The order of patterns is preserved, so the first matching pattern will be used.
View blocked queries
Blocked queries are logged, as well as counted in the cortex_query_frontend_rejected_queries_total
metric on a per-tenant basis.
Was this page helpful?
Related resources from Grafana Labs
Additional helpful documentation, links, and articles:

Intro to metrics with Grafana: Prometheus, Grafana Mimir, and beyond
In this webinar, we’ll go over challenges when scaling metrics systems, with a particular focus on Prometheus and Grafana Mimir.

Intro to Grafana Mimir: The open source time series database that scales to 1 billion metrics & beyond
In this webinar, learn about Grafana Mimir, our open source solution for extending Prometheus at organizations needing massive scale, rapid query performance.

For billion-series scale or home IoT projects, get started in minutes with Grafana Mimir
Learn how easy it is to get started with Mimir, no matter how many or few time series you need to store.