Index of every page on this site: llms.txt
All skills
Run it yourself

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

Use this Skill: https://skilld.dev/gh/nodnarbnitram/claude-code-extensions/grafana-billing

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈46 tokens for metadata: the name and description. ≈598 when used: this file. ≈1.9k more on demand in 2 files.

Description uses 2.3% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈186 characters, or 2.3%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

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

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning1mo4 checks · Risk SAFE
  • Gen Agent Trust Hub1mo

    The Grafana Billing Metrics skill is a legitimate tool for monitoring observability costs and metrics. It follows security best practices, including secure environment variable handling for API keys and communication with official AWS Managed Grafana service domains. No malicious patterns or vulnerabilities were identified.

  • Socket1mo

    No alerts

  • Snyk1mo

    Risk: LOW · No issues

  • Runlayer8mo

    8/8 files flagged

Signed by skilld at 35e7f7d. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Dormantupdated 8 months ago

README badge

README badge for nodnarbnitram/claude-code-extensions/grafana-billing