Grafana Cloud

Configure recommendation generation in Adaptive Metrics

Grafana Adaptive Metrics decides how to generate aggregation recommendations on your behalf. By default, it treats every dashboard, every alerting and recording rule, and every query executed in the last 30 days as a signal that a metric is in use. These defaults work well for most organizations, but your priorities might differ.

Recommendation configurations let you define those priorities yourself. A recommendation configuration is a named set of options that controls how Adaptive Metrics generates recommendations for your metrics.

Before you begin

To modify the usage sources, you need a role that includes the grafana-adaptive-metrics-app.segments:write action, such as Admin or Segments Editor. Without this permission, the Dashboards and Queries sources are read-only. For more information, refer to Configure RBAC for Adaptive Metrics.

Metrics usage sources

Metrics usage sources control which kinds of usage the recommendations service counts when it decides whether a metric, or one of its labels, is in use.

The recommendations service collects usage information from three sources. Each source captures a different kind of usage:

  • Dashboards: A metric counts as used if it appears in the definition of any saved dashboard in your Grafana Cloud stack. The recommendations service scans every panel query, template variable, and annotation query in your saved dashboards. Because this scan reads the saved dashboard definitions, not dashboard views, a metric counts as used even if no one ever opens the dashboard.
  • Alerting & recording rules: A metric counts as used if it appears in the definition of any alerting or recording rule. This source is always enabled.
  • Queries: A metric counts as used if it appears in your query history from the last 30 days. Query history contains every query that was actually executed, regardless of where it came from: queries that run when someone opens a dashboard, one-off queries in Explore, queries sent directly to the Prometheus HTTP API, and queries executed by any other tool or script.

The Dashboards and Queries sources overlap. When someone views a dashboard, Grafana executes the panel queries, and those executed queries also become part of your query history. As a result:

  • A dashboard that nobody views is only counted by the Dashboards source.
  • A dashboard that people view is counted by both sources: by Dashboards because of its saved definition, and by Queries because of the executed panel queries.

For more information about how the recommendations service analyzes usage, refer to Understand recommended rules.

How excluding a source changes recommendations

Excluding a usage source tells the recommendations service to ignore that kind of usage. Metrics whose only usage comes from excluded sources are treated as unused, so Adaptive Metrics can recommend aggregating them more aggressively.

  • Exclude Dashboards to stop unused dashboards from holding back recommendations. Metrics that appear only in saved dashboard definitions no longer count as used. Dashboards that your team actively views remain protected through the Queries source, because viewing a dashboard executes its queries.
  • Exclude Queries to stop one-off queries from holding back recommendations. A metric that someone queried once in Explore no longer counts as used. Metrics referenced in dashboards and rules remain protected.

Note

The recommendation configuration must always include the Alerting & recording rules source. Aggregating or dropping a metric that’s referenced in an alerting or recording rule would silently break the rule, potentially causing missed alerts.

Manage the recommendation configuration using the UI

Manage the recommendation configuration in the Metrics usage sources section of the Configuration tab. This configuration is the global default and applies across all segments.

  1. Navigate to Adaptive Metrics > Configuration.

  2. In the Metrics usage sources section, select or clear the following sources:

    • Dashboards: Count metrics referenced in saved dashboard definitions as actively used, even if no one opens the dashboard.
    • Queries: Count metrics from every executed query as actively used, including queries that run when someone opens a dashboard, queries in Explore, and queries sent through the API.

    The Alerting & recording rules source is always enabled and can’t be cleared.

  3. Click Save.

Changes affect all metric rules across all segments the next time recommendations are generated. Expect differences in projected savings and in the number of generated recommendations.

Next steps