Cost Management
Grafana LabsOfficialPublished by Grafana Labs
- Skill
- Tool integration
- Cloud and DevOps
- Apache-2.0
- Low risk
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a structured approach to managing and reducing Grafana Cloud expenses. It focuses on three primary levers: attributing costs to specific teams using external labels, reducing telemetry volume through Adaptive signals (Metrics, Logs, and Traces), and proactive monitoring via usage alerts. The guide includes configuration snippets for Alloy, API-based recommendations for cardinality reduction, and specific strategies for filtering noisy logs and sampling trace data.
What it does
- Configures cost-attribution labels in Alloy to track spend by team or project.
- Implements Adaptive Metrics to reduce high-cardinality series.
- Filters out noisy or unnecessary logs using drop stages in Alloy.
- Configures tail-sampling for traces to reduce ingestion volume while keeping critical data.
- Sets up proactive usage alerts to monitor quota consumption.
- Provides a checklist for ongoing observability cost optimization.
When to use it
- When you need to investigate or explain a high Grafana Cloud bill.
- When you need to identify which teams or services are consuming the most observability resources.
- When you need to reduce active series, log ingestion bytes, or trace span volume.
- When you want to set up automated alerts before hitting billing quotas.
Advantages
- Directly reduces cloud spend by optimizing telemetry ingestion.
- Improves cost transparency through team-based attribution.
- Provides actionable, data-driven recommendations for cardinality reduction.
- Offers clear, copy-pasteable configuration patterns for Alloy.
Usage examples
- “How can I see which team is responsible for our high Grafana Cloud metrics bill?”
- The agent will guide you to add 'team' and 'project' external labels in your Alloy configuration and then use the Cost Management dashboard to group usage by those labels.
- “Our log ingestion is too high; how do I drop debug logs in Grafana Cloud?”
- The agent will provide an Alloy configuration snippet using a loki.process stage with a drop rule to filter out logs where the level is set to debug.
- “How do I reduce the number of active series in our metrics?”
- The agent will explain how to pull recommendations from the Adaptive Metrics API and apply rules to keep only meaningful labels for high-cardinality metrics.
- “Can you help me set up an alert for when we reach 80% of our metrics quota?”
- The agent will provide a Prometheus alert rule using the grafana_cloud_metrics_active_series and grafana_cloud_metrics_limit metrics to trigger a warning.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/grafana/cost-management/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip cost-management.zip -d .agents/skills
Documentation by Grafana Labs
Grafana Cloud Cost Management
Docs: https://grafana.com/docs/grafana-cloud/cost-management-and-billing/
Reduce metric / log / trace spend with Adaptive signals + cost-attribution labels.
Prerequisites
A Grafana Cloud stack with Adaptive Metrics / Logs / Traces enabled (visible under Cost Management)
Alloy (or Grafana Agent) ingesting telemetry, with API key in scope
metrics:write+logs:write(+traces:write)Admin access to the stack to apply Adaptive recommendations
Common Workflows
1. Attribute cost to a team / service
# 1. Add external labels in Alloy (metrics + logs configs)
prometheus.remote_write "cloud" {
endpoint { url = sys.env("PROMETHEUS_URL") /* ... */ }
external_labels = { team = "platform", project = "checkout-service" }
}# 2. Reload Alloy
curl -X POST http://localhost:12345/-/reload
# 3. Verify labels arrived in Grafana Cloud
# In Explore, run: count by (team, project) ({__name__=~".+"})
# Then visit Cost Management → group by `team` / `project`See references/adaptive-signals.md for the full Alloy snippet.
2. Cut metric cardinality with Adaptive Metrics
# 1. Pull recommendations
curl https://<stack>.grafana.net/api/plugins/grafana-adaptive-metrics-app/resources/v1/recommendations \
-H "Authorization: Bearer <token>" | jq '.recommendations | length'
# 2. In the UI: Grafana Cloud → Adaptive Metrics → review rules sorted by series-reduction impact
# 3. Test in "Preview" mode before applying
# 4. Apply (takes effect within 5 min)
# 5. Verify — series count should drop on the affected metrics
# Before applying, capture baseline:
# count({__name__="http_request_duration_seconds_bucket"})
# Wait 10 min after apply, run again — expect 10x+ reduction for high-card metrics.
# Rollback if needed: open the rule in the UI → Disable, or DELETE /v1/rules/<id>.3. Drop noisy logs in Alloy
# 1. Add a filter stage (see references/adaptive-signals.md for the full block)
loki.process "filter_logs" {
forward_to = [loki.write.cloud.receiver]
stage.drop { expression = ".*GET /health.*" }
}# 2. Reload Alloy
curl -X POST http://localhost:12345/-/reload
# 3. Verify the filter — health logs should NOT appear in Logs Drilldown
# LogQL check (should return 0):
# sum(rate({app="my-app"} |= "GET /health" [5m]))
# Bytes-ingested should also drop. Compare 24h before/after:
# sum(increase(loki_ingester_chunk_size_bytes_sum[24h])) by (namespace)4. Set a usage alert before you hit quota
See references/alerts-and-queries.md for ready-to-paste rules (MetricsUsageHigh, LogsIngestionHigh).
Optimization checklist
[ ] Apply Adaptive Metrics recommendations — typically reduces series 40-60%
[ ] Drop health/readiness probe logs in Alloy
[ ] Tail-sample traces to 5-10% + keep errors / slow spans
[ ] Add
team+projectexternal labels to every Alloy config[ ] Set usage alerts at 80% of quota
[ ] Replace expensive ad-hoc queries with recording rules
References
references/adaptive-signals.md— Adaptive Metrics / Logs / Traces config; cost-attribution labelsreferences/alerts-and-queries.md— usage alert rules, cost-finding PromQL, billing-unit table
Resources
Files
- ATTRIBUTION.mdAdded by AutoGineer851 B
- LICENSELicence file added by AutoGineer11.1 KiB
- SKILL.md4.5 KiB
- references/adaptive-signals.md2.1 KiB
- references/alerts-and-queries.md1.3 KiB
ATTRIBUTION.md
Attribution
This folder is an unmodified copy of the Agent Skill "cost-management", 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
What our scanner noticed· Low risk
- Instructions that use the network
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/cost-management · 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 cost-management.zip