Skip to content
Back to skills

Grafana Billing

ASecurity

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

  • 666 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added February 8, 2026
toolsbashapi

Works with

  • api

Security analysis

A100/100

Scanned February 12, 2026

npx -y skills add majiayu000/claude-skill-registry --skill grafana-billing --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Grafana Billing?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Grafana Billing
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-grafana-billing/badge)](https://www.skillsdirectory.com/skills/majiayu000-grafana-billing)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: grafana-billing
description: Query Prometheus and Loki billing metrics from Grafana. Use when discussing observability costs, active series, ingestion rates, storage usage, or cardinality analysis.
---

# Grafana Billing Metrics Skill

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

## Quick Start

```bash
# Query both staging and prod (default)
uv run .claude/skills/grafana-billing/scripts/billing_metrics.py

# Query specific environment
uv run .claude/skills/grafana-billing/scripts/billing_metrics.py --env staging
uv run .claude/skills/grafana-billing/scripts/billing_metrics.py --env prod

# JSON output for automation
uv run .claude/skills/grafana-billing/scripts/billing_metrics.py --json

# Filter to specific service
uv run .claude/skills/grafana-billing/scripts/billing_metrics.py --service prometheus
uv run .claude/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

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.