prometheus-cardinality-troubleshooter

prometheus-cardinality-troubleshooter is a skill for Claude Code from grafana/skills. It costs 138 tokens per session (4,545 once invoked), scanned A, original, Apache-2.0.

A diagnostic guide for Prometheus cardinality problems. Prometheus is a monitoring system, and cardinality is the number of distinct time series created by metric labels.

In plain words
What is it for?
It helps investigate slow queries, memory growth, high active-series or data-point costs, series churn, and related Prometheus or Grafana Cloud issues.
Why use it?
Too many distinct series can make Prometheus slow, cause out-of-memory failures, produce ingestion errors, or increase monitoring costs. The guide helps find which metrics and labels are responsible.

Skill for Claude Code ✓ vendor

Written for Claude Code: shipped in a Claude Code plugin.

Part of the grafana-cloud plugin — 19 skills shipped together

Good fit It helps investigate slow queries, memory growth, high active-series or data-point costs, series churn, and related Prometheus or Grafana Cloud issues.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/grafana/skills/prometheus-cardinality-troubleshooter
About the project

Grafana Skills is a collection of agent skills for working with Grafana, Prometheus, Loki, Tempo, Pyroscope, k6, and the broader LGTM observability stack. Developers and operators use the skills with coding agents that support the Agent Skills standard. The catalogue entries are the repository’s own skills, plugins, and instructions for using these observability tools.

grafana/skills · 253 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add grafana/skills --skill prometheus-cardinality-troubleshooter
Clone the repo
git clone --depth 1 https://github.com/grafana/skills

Made for: Claude Code.

Or install grafana-cloud, the plugin that ships this one along with the rest of its 19 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for prometheus-cardinality-troubleshooter

README.md
[![agentmods](https://agentmods.dev/badge/skills/grafana/skills/prometheus-cardinality-troubleshooter/github.svg)](https://agentmods.dev/skills/grafana/skills/prometheus-cardinality-troubleshooter)
Your own site
<a href="https://agentmods.dev/skills/grafana/skills/prometheus-cardinality-troubleshooter"><img src="https://agentmods.dev/badge/skills/grafana/skills/prometheus-cardinality-troubleshooter/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for prometheus-cardinality-troubleshooter

Your own site · 80×15
<a href="https://agentmods.dev/skills/grafana/skills/prometheus-cardinality-troubleshooter"><img src="https://agentmods.dev/badge/skills/grafana/skills/prometheus-cardinality-troubleshooter.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 138 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,545 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 4 Aug 2026
  • Snyk fail 4 Aug 2026
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00138 $0.04545
Opus 5 $0.00069 $0.02273
Sonnet 5 $0.00028 $0.00909
Haiku 4.5 $0.00014 $0.00455

Measured 12d ago against content hash dd24befa71ed, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

prometheus-cardinality-troubleshooter scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s http://prometheus:9090/api/v1/status/tsdb | jq
skills/grafana-cloud/prometheus-cardinality-troubleshooter/SKILL.md · 420 lines

How it starts

The opening of the file, as written. The whole thing — 420 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Prometheus Cardinality Troubleshooter

You are an expert in diagnosing live Prometheus cardinality problems. When a user reports a Prometheus performance, memory, or cost issue that smells like cardinality, use this guide to triage systematically.

This skill is diagnostic and operational. For schema design and prevention, route to prometheus-label-strategy.


Before You Remediate: The One Rule

Under pressure, the tempting move is to labeldrop the high-cardinality label at scrape time. Do not. You cannot remove, at scrape time, any label that makes a series unique — not pod, not instance, not anything that distinguishes one real series from another. It looks like it stops the bleeding; it actually breaks the data:

  • Counter resets from different series get merged → rate() and increase() return garbage, often absurdly high values.
  • Multiple samples land on the same series per scrape → duplicate-sample / out-of-order errors and inflated DPM, not reduced.
  • The breakage is silent (no config error) and leaves no evidence in the data of where it went wrong. Weeks later someone asks "why is my DPM so high / why is rate() absurd?" and there's nothing to point to.

The only safe remediations are:

  1. Drop an entire unwanted metric (action: drop on __name__) — you're discarding the whole metric, not merging distinct series.
  2. Fix the source — stop the application emitting the bad label (the real fix for unbounded path, user_id, etc.).
  3. Adaptive Metrics — for structural cardinality on series you can't fix at the source. It aggregates correctly (counter-reset-aware, audited, reversible). This is the right way to reduce the cost of a label like pod. Route to adaptive-metrics.

Everywhere below that says "drop a label," read it through this rule: drop whole metrics, fix the source, or use Adaptive Metrics — never labeldrop a distinguishing label.


Symptom → Likely Cause

Symptom Likely Cause First Action
Prometheus OOMKilled or memory growing linearly Active series growth (often from a new bad metric or label) Active Series triage
Single PromQL query slow or OOMs the querier One or more metrics in the query have high cardinality Per-query drill-down
Remote write lagging, WAL growing Sample throughput spike — series count OR scrape interval changed Active Series triage + check scrape intervals
429 Too Many Samples / out of bounds errors Hitting Mimir/Cortex ingester per-tenant series limit Per-metric drill-down, find the new offender
Grafana Cloud Active Series bill spiked New metric, new label, or rollout creating churn Per-metric drill-down + churn check
Grafana Cloud DPM bill spiked but Active Series flat Scrape interval shortened, OR remote_write sending duplicates DPM-side issue — route to dpm-finder
series_limit_per_user errors after a deploy Application change introduced a new bad label Recent change diff
Series count grows then resets every restart Series churn from ephemeral label values Churn diagnosis

Read the full file on GitHub · 420 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 420 lines · 138 tokens per session scan A dd24befa71ed

Subscribe to this mod's changes

prometheus-cardinality-troubleshooter is a skill published in the GitHub repository grafana/skills (253 stars, last pushed today), licensed Apache-2.0. It adds 138 tokens to every session and 4,545 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

debug-optimize-lcp

Guides debugging and optimizing Largest Contentful Paint (LCP) using Chrome DevTools MCP tools. Use this skill whenever the user asks about LCP performance, slow page loads, Core Web Vitals optimization, or wants to understand why their page's main content takes too long to appear. Also use when the user mentions…

ChromeDevTools/chrome-devtools-mcp · 99 tokens

systematic-debugging

Use when debugging a failing test, build error, or runtime issue that isn't immediately obvious. Guides a 4-phase root cause analysis instead of random fix attempts.

open-metadata/OpenMetadata · 37 tokens

diagnose

Trace from a reproduced symptom to the source code that causes it. Pin the specific file and approximate line, rate confidence in the cause and clarity of the fix independently, and always propose a concrete fix.

emdash-cms/emdash · 43 tokens

repro-admin

Reproduce an EmDash admin UI bug. Attach a container, start the demo dev server, drive the admin with agent-browser using the dev-bypass session, and capture the reproduction as screenshots plus a replayable transcript.

emdash-cms/emdash · 48 tokens

log-error-digest

Analyze log files to troubleshoot errors, identify peak error periods, and produce error clustering, frequency statistics, and time distribution reports. Supports JSON, syslog, and Nginx formats with automatic detection. Use when a user uploads a .log file and asks to analyze errors, find patterns, debug issues, or…

zebbern/claude-code-guide · 71 tokens

byted-util-volcengine-detect-retry

An orchestration workflow for Volcengine Cloud Detect, a service that checks websites or network endpoints from test locations.

bytedance/agentkit-samples · 101 tokens