Adaptive Metrics
Grafana LabsOfficialPublished by Grafana Labs
- Skill
- Tool integration
- Cloud and DevOps
- Apache-2.0
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
Adaptive Metrics provides a framework for controlling metrics billing in Grafana Cloud by reducing the active series count. It enables users to identify high-cardinality labels and unused metrics, then apply aggregation rules or drop configurations to shrink the data footprint before storage. The process involves reviewing automated recommendations, creating custom exact or regex-based aggregation rules, and verifying the impact on series counts.
What it does
- Generates recommendations for reducing active series based on query history.
- Allows creation of custom aggregation rules using exact or regex matching.
- Identifies unused metrics that can be safely dropped to save costs.
- Provides methods to drop specific labels that contribute to high cardinality.
- Supports verification of series reduction impact through query metrics.
- Offers a fallback configuration for dropping metrics at the remote write stage.
When to use it
- When investigating high costs in a Grafana Cloud metrics bill.
- When dealing with exploding active series counts due to high-cardinality labels.
- When you need to pre-aggregate counters or gauges to optimize storage.
- When you want to remove unused metrics that are still being sent to the cloud.
- When you need to verify the effectiveness of cardinality reduction strategies.
Advantages
- Directly impacts billing by reducing the number of active series.
- Automated recommendations simplify the identification of optimization targets.
- Flexible rule creation supports both specific and broad metric patterns.
- Provides clear verification steps to measure the success of applied rules.
Usage examples
- “How can I see which metrics are recommended for aggregation to lower my bill?”
- The agent retrieves the recommendation list from the Adaptive Metrics API, showing metric names, current series counts, and estimated reduction percentages.
- “I need to drop the version label from my CPU metrics to reduce cardinality.”
- The agent guides you through creating a custom aggregation rule that targets the specific metric and drops the requested labels using a sum aggregation type.
- “How do I find and remove unused metrics in my Grafana Cloud instance?”
- The agent lists unused metrics via the usage analysis endpoint and provides instructions for verifying their lack of use in dashboards or alerts before dropping them.
- “How can I check if my aggregation rules are actually working?”
- The agent provides PromQL queries to monitor the total active series and the specific count of series dropped by your active aggregation rules.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/grafana/adaptive-metrics/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip adaptive-metrics.zip -d .agents/skills
Documentation by Grafana Labs
Grafana Cloud Adaptive Metrics
Aggregation rules that pre-shrink high-cardinality metrics before storage — directly reduces active-series billing.
Prerequisites
Grafana Cloud Metrics plan (any paid tier)
API key with
metrics:write(for the Adaptive Metrics API —adaptive-metrics.grafana.net, Bearer auth)For the verification queries: the metrics query endpoint (
prometheus-prod-XX.grafana.net) uses HTTP basic auth —<metrics_user>(numeric stack/instance ID) plus a token withmetrics:read— not the Bearer keyAccess to Home → Adaptive Metrics in the Cloud portal
Common Workflows
1. Review + apply auto-recommendations
# 1. Pull the recommendation list (sorted by series-reduction impact)
curl -s -H "Authorization: Bearer <KEY>" \
"https://adaptive-metrics.grafana.net/api/v1/recommendations" \
| jq '.recommendations[] | {metric_name, current_series, projected_series, estimated_reduction_percent}'
# 2. Capture the baseline series count for the target metric
# (metrics query endpoint = basic auth, not the Bearer key)
curl -s -u "<metrics_user>:<metrics_token>" \
"https://prometheus-prod-XX.grafana.net/api/prom/api/v1/query?query=count({__name__=\"process_cpu_seconds_total\"})" \
| jq '.data.result[0].value[1]' # → e.g. "12480"
# 3. Apply the recommendation (or click Apply in the UI)
curl -s -X POST -H "Authorization: Bearer <KEY>" \
"https://adaptive-metrics.grafana.net/api/v1/recommendations/<ID>/apply"
# 4. Wait ~5 min. Verify — re-run the count query; expect a large drop.
# Also check the saving metric:
# grafanacloud_instance_active_series_dropped_by_aggregation_rulesRollback — delete the rule:
curl -s -H "Authorization: Bearer <KEY>" \
"https://adaptive-metrics.grafana.net/api/v1/rules" | jq '.rules[] | {id, metric_name}'
curl -s -X DELETE -H "Authorization: Bearer <KEY>" \
"https://adaptive-metrics.grafana.net/api/v1/rules/<RULE_ID>"
# Or in the UI: Rules → row → Disable2. Hand-write a custom rule
# 1. Sanity-check the metric is not used WITH that label in dashboards/alerts
grep -r 'process_cpu_seconds_total' dashboards/ alerts/ | grep -E 'version|go_version'
# Expect no hits → safe to drop.
# 2. Create the rule
curl -s -X POST -H "Authorization: Bearer <KEY>" -H "Content-Type: application/json" \
"https://adaptive-metrics.grafana.net/api/v1/rules" \
-d '{"rules":[{"metric_name":"process_cpu_seconds_total","match_type":"MATCH_TYPE_EXACT",
"drop_labels":["version","go_version"],
"aggregations":[{"type":"AGGREGATION_TYPE_SUM"}]}]}'
# 3. Verify — same count() query as above; series count should drop within 5 min.Full payloads (regex match, aggregation types, all caveats): references/api.md.
3. Drop unused metrics entirely
# 1. List unused metrics
curl -s -H "Authorization: Bearer <KEY>" \
"https://adaptive-metrics.grafana.net/api/v1/usage-analysis?filter=unused" | \
jq '.metrics[] | {metric_name, series_count, last_queried}'
# 2. Confirm not referenced in dashboards / alerts / recording rules
grep -r '<METRIC_NAME>' dashboards/ alerts/ recording-rules/
# 3. Add a write_relabel_config drop in Alloy (full block in references/api.md)
# Reload Alloy: curl -X POST http://localhost:12345/-/reload
# 4. Verify — the metric should no longer appear in series counts after ~10 min
curl -s -u "<metrics_user>:<metrics_token>" \
'https://prometheus-prod-XX.grafana.net/api/prom/api/v1/label/__name__/values' | jq '.data | index("<METRIC_NAME>")' # → nullMeasure the impact
# Total active series (billed unit)
grafanacloud_instance_active_series
# Series specifically dropped by Adaptive Metrics rules
grafanacloud_instance_active_series_dropped_by_aggregation_rulesRules take effect within ~5 minutes; full billing impact appears within an hour. The original high-cardinality samples keep flowing but the dropped labels no longer count toward billing.
Resources
Files
- ATTRIBUTION.mdAdded by AutoGineer853 B
- LICENSELicence file added by AutoGineer11.1 KiB
- SKILL.md5.2 KiB
- references/api.md3.3 KiB
ATTRIBUTION.md
Attribution
This folder is an unmodified copy of the Agent Skill "adaptive-metrics", distributed by AutoGineer (https://autogineer.com/agent-skills).
Commit: 8fb72a527961f05e708f53d2a0500709e12d7970
Published by: Grafana Labs (https://github.com/grafana)
Publisher: Grafana Labs (https://github.com/grafana)
Licence: Apache License 2.0 (https://spdx.org/licenses/Apache-2.0.html)
Licence evidence: declared in the frontmatter ("license: Apache-2.0")
Retrieved: 2026-11-07
The skill's own files are unmodified copies. AutoGineer is not affiliated with or endorsed by the author or the publisher.
Files added by AutoGineer
ATTRIBUTION.md: this file, written by AutoGineer
LICENSE: copied from LICENSE
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs network access, Needs an API key
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- Grafana Labs
- Publisher
- Grafana Labs (Official)
- Source
- grafana/skills · skills/grafana-cloud/adaptive-metrics · commit 8fb72a5
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Grafana Labs.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download adaptive-metrics.zip