Generated banner for Dpm Finder
Generated logo for Dpm Finder

Dpm Finder

Grafana LabsOfficialPublished by Grafana Labs

  • Skill
  • Tool integration
  • Cloud and DevOps
  • Apache-2.0
  • Low risk

From the author

Find the Prometheus metrics that drive your Grafana Cloud bill. `dpm-finder` is a Grafana Professional Services CLI that ranks metrics by Data Points per Minute (DPM) with per-label-set breakdown, optional `--cost-per-1000-series` pricing, and a Prometheus-exporter mode. Use when investigating high Grafana Cloud spend, hunting noisy / high-cardinality metrics, comparing pre/post recording-rule cardinality, or feeding cost data into dashboards — even when the user says "why is my Mimir bill so high?", "find the biggest metrics", "cardinality offenders", or "optimize Prometheus cost" without naming dpm-finder.
— the description by Grafana Labs

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

dpm-finder is a specialized command-line interface designed to help users analyze their Prometheus metric usage within Grafana Cloud. By calculating Data Points per Minute (DPM) and providing a per-label-set breakdown, it enables administrators to pinpoint noisy or high-cardinality metrics that contribute most to their cloud spend. The tool supports multiple output formats, optional cost estimation, and an exporter mode for continuous monitoring.

What it does

  • Ranks Prometheus metrics by Data Points per Minute (DPM).
  • Provides granular per-label-set breakdowns to identify specific high-cardinality offenders.
  • Calculates estimated costs when provided with pricing parameters.
  • Supports multiple output formats including CSV, JSON, and Prometheus exposition format.
  • Includes an exporter mode to serve metrics for ongoing monitoring.
  • Automatically excludes internal Grafana metrics and those with existing aggregation rules.

When to use it

  • When investigating unexpectedly high Grafana Cloud bills.
  • When hunting for noisy or high-cardinality metrics impacting system performance.
  • When comparing metric cardinality before and after implementing recording rules.
  • When you need to feed cost data into custom dashboards for better visibility.

Advantages

  • Directly links metric usage to potential billing drivers.
  • Simplifies the identification of specific label combinations causing high cardinality.
  • Flexible integration options via CLI, Docker, or Prometheus exporter mode.
  • Built-in retry logic and exponential backoff to handle API rate limits.

Usage examples

“Find the top 10 metrics by DPM in my Grafana Cloud instance.”
The tool scans the instance and outputs a list of the 10 most active metrics, showing their DPM and series count.
“How can I estimate the cost of my high-cardinality metrics?”
Running the tool with the --cost-per-1000-series flag adds an estimated_cost column to the output report.
“Run dpm-finder as a Prometheus exporter.”
The tool starts a local server on port 9966, exposing metric analysis data for collection by other monitoring tools.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/grafana/dpm-finder/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip dpm-finder.zip -d .agents/skills

Documentation by Grafana Labs

dpm-finder

Grafana PS tool ranking Prometheus metrics by DPM with per-series breakdown. Source: https://github.com/grafana-ps/dpm-finder

Prerequisites

  • Python 3.9+

  • A Grafana Cloud Prometheus endpoint URL + numeric stack ID + API key (glc_…, metrics:read scope)

Common Workflows

One-shot analysis (most common)
# 1. Clone + venv + install
git clone https://github.com/grafana-ps/dpm-finder.git
cd dpm-finder
python3 -m venv venv && source venv/bin/activate
pip install -r requirements.txt

# 2. Configure creds — copy .env_example → .env and fill in:
#    PROMETHEUS_ENDPOINT  https://prometheus-<cluster_slug>.grafana.net  (NOTHING after .net)
#    PROMETHEUS_USERNAME  <numeric stack id>
#    PROMETHEUS_API_KEY   glc_…

# 3. Verify creds before scanning — should return >0 series count
curl -s -u "$PROMETHEUS_USERNAME:$PROMETHEUS_API_KEY" \
  "$PROMETHEUS_ENDPOINT/api/v1/label/__name__/values" | jq '.data | length'

# 4. Run the scan (10-min lookback, 2.0 DPM minimum, top output)
./dpm-finder.py -f json -m 2.0 -t 8 --timeout 120 -l 10

# 5. Read the result — top 10 metrics by DPM
jq -r '.metrics | sort_by(-.dpm) | .[:10][] | "\(.dpm)\t\(.series_count)\t\(.metric_name)"' metric_rates.json

If step 5 is empty, lower -m or confirm the endpoint URL has no trailing path after .net.

Discover stack details with gcx

If gcx is installed it can derive the endpoint + username:

gcx config check          # active stack context
gcx config list-contexts  # all configured stacks
gcx config view           # full config with endpoints

The Prometheus endpoint pattern is https://prometheus-{cluster_slug}.grafana.net. Username is the numeric stack ID.

Without gcx: look up in the Grafana Cloud portal, or query grafanacloud_instance_info{name=~"STACK_NAME.*"} on the usage datasource.

Multi-stack runs

Limit to max 3 concurrent runs to avoid GCloud rate limits. Batch the stacks and wait for each batch before the next.

Interpreting results

  • DPM = max data points per minute across that metric's series

  • series_count = active time-series count for that metric

  • series_detail[] (JSON / text only) = per-label-combination DPM breakdown — use this to spot the offending label

  • Sort by DPM descending → noisiest metrics; combine with --cost-per-1000-series to prioritize by spend

Troubleshooting

  • 401 / 403 — API key invalid or missing metrics:read; confirm PROMETHEUS_USERNAME is the numeric stack ID

  • Timeouts — bump --timeout to 120+ for stacks with thousands of metrics

  • HTTP 422 — metric has aggregation rules; tool warns + skips automatically

  • Empty results — lower -m; verify endpoint has no trailing path

  • Connection errors — exponential backoff retries up to 10 times; persistent failure usually = network/firewall

References

  • references/cli.md — full flag reference, output-format details, exporter mode, Docker invocation, auto-exclusion rules, retry behavior

Resources

Files

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 an API key, Needs a command-line tool, Needs Python

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/dpm-finder · 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 or Grafana Labs.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download dpm-finder.zip