Command Palette

Search for a command to run...

UnylyUnyly
Back to skills

grafana-billing

FreeRuns bundled scriptsNot checked

Query Prometheus and Loki billing metrics from Grafana. Use when discussing observability costs, active series, ingestion rates, storage usage, or cardinality…

nodnarbnitramby nodnarbnitram★ 19 GitHub stars

About this skill

Grafana Billing Metrics Skill

Query key billing metrics from Prometheus and Loki through Grafana's data source proxy API.

Quick Start

# Query both staging and prod (default)
uv run ${CLAUDE_PLUGIN_ROOT}/skills/grafana-billing/scripts/billing_metrics.py

# Query specific environment
uv run ${CLAUDE_PLUGIN_ROOT}/skills/grafana-billing/scripts/billing_metrics.py --env staging
uv run ${CLAUDE_PLUGIN_ROOT}/skills/grafana-billing/scripts/billing_metrics.py --env prod

# JSON output for automation
uv run ${CLAUDE_PLUGIN_ROOT}/skills/grafana-billing/scripts/billing_metrics.py --json

# Filter to specific service
uv run ${CLAUDE_PLUGIN_ROOT}/skills/grafana-billing/scripts/billing_metrics.py --service prometheus
uv run ${CLAUDE_PLUGIN_ROOT}/skills/grafana-billing/scripts/billing_metrics.py --service loki

Environment Variables Required

  • GRAFANA_STAGING_API_KEY - API key for staging Grafana workspace
  • GRAFANA_PROD_API_KEY - API key for prod Grafana workspace

Key Metrics Captured

Prometheus

Metric Description
Active Time Series Current count of active series (billing dimension)
Samples/sec Ingestion rate (DPM = samples/sec * 60)
TSDB Storage On-disk storage bytes
Top Cardinality Top 10 metrics by series count

Loki

Metric Description
Ingestion Rate GB/day being ingested
Total Bytes Cumulative bytes received
Active Streams Number of active log streams
Memory Chunks Chunks held in memory

When to Use

Use this skill when the user asks about:

  • Observability billing or costs
  • Active time series counts
  • Prometheus cardinality analysis
  • Loki ingestion rates
  • Storage usage for metrics or logs
  • Comparing staging vs production usage

Instructions for Claude

  1. Run the billing metrics script to gather current data
  2. Present the results in a clear, formatted way
  3. Highlight any concerning metrics (high cardinality, rapid growth)
  4. Compare staging vs prod if both are queried
  5. Suggest cost optimization if metrics are unusually high

Critical Rules

  • Always check that API keys are set before running
  • Use --json flag when you need to process the output programmatically
  • Default to querying both environments for comparison
  • Handle errors gracefully - missing data sources should not crash the script

Install grafana-billing in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

Bundled files

README.mdreferences/billing-metrics.mdscripts/billing_metrics.pyscripts/formatters.pyscripts/grafana_client.pyscripts/loki_metrics.pyscripts/prometheus_metrics.py

FAQ

What does the grafana-billing skill do?

Query Prometheus and Loki billing metrics from Grafana. Use when discussing observability costs, active series, ingestion rates, storage usage, or cardinality analysis.

How do I install the grafana-billing skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the grafana-billing skill run scripts?

Yes, this skill bundles executable scripts. Review the source before installing.

Related skills

Compare grafana-billing with