dpm-finder
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 hi
Security Assessment
About dpm-finder
dpm-finder is a catalogue skill that wraps a Grafana Professional Services command-line tool for finding the Prometheus metrics that drive a Grafana Cloud bill. It solves the problem of not knowing which metrics are responsible for high spend by ranking them by Data Points per Minute (DPM), with an optional per-label-set breakdown that pinpoints the exact label combination causing cardinality blow-up. The skill itself is a usage guide pointing to the upstream open-source tool at github.com/grafana-ps/dpm-finder; it does not bundle new functionality but documents how to install, configure, and run it safely.
The main workflow is a one-shot analysis: clone the repo, create a virtualenv, install requirements, copy the .env example and fill in the Prometheus endpoint, numeric stack ID, and a metrics:read API key, verify credentials with a read-only curl, then run the scanner and sort results by DPM. Additional capabilities documented include a Prometheus-exporter mode that serves recalculated metrics on a port, optional `--cost-per-1000-series` pricing, a Docker invocation, discovering stack details via the companion gcx tool, and guidance on multi-stack batching to stay within rate limits. A CLI reference file lists every flag, the output formats (CSV, JSON with per-series detail, text, and Prometheus exposition), auto-exclusion rules for histogram components and metrics with aggregation rules, and exponential-backoff retry behavior.
It is aimed at Grafana Cloud administrators, SREs, and cost engineers investigating high Mimir/Prometheus spend, hunting high-cardinality offenders, comparing cardinality before and after recording rules, or feeding cost data into dashboards. Prerequisites are Python 3.9+ and read-scoped Grafana Cloud credentials.
FAQ
What are the prerequisites?
Python 3.9+ and a Grafana Cloud Prometheus endpoint URL, the numeric stack ID, and an API key with metrics:read scope. Credentials are stored in a local .env file copied from the provided example.
Does it change or delete any of my metrics?
No. It only reads metric metadata to rank metrics by DPM; the API key it uses is scoped to metrics:read and the tool queries label and series endpoints without writing.
How do I interpret the output?
DPM is the maximum data points per minute across a metric's series, series_count is the active time-series count, and the JSON series_detail array gives a per-label-combination breakdown so you can spot the offending label. Sort by DPM descending to find the noisiest metrics.
Can it run continuously or in CI?
Yes. It has an exporter mode that serves results at a /metrics endpoint and recalculates on a configurable interval, and it can be run via Docker with an env file. Grafana recommends limiting to a maximum of three concurrent runs to avoid rate limits.
What if I get empty results or auth errors?
Empty results usually mean the DPM threshold is too high or the endpoint URL has a trailing path after .net; 401/403 means the API key is invalid or missing metrics:read, or the username is not the numeric stack ID. The tool retries with exponential backoff and skips metrics that return HTTP 422 due to aggregation rules.
Install dpm-finder
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
grafana/skills