metrics-cardinality

Detect high-cardinality tags in StatsD/Datadog metric calls in Ruby .rb files.

Updated Feb 27, 2026
One-click install
npx skills add https://github.com/dailydm/skills --skill metrics-cardinality
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: metrics-cardinality
Source: https://github.com/dailydm/skills/tree/main/metrics-cardinality
Command: npx skills add https://github.com/dailydm/skills --skill metrics-cardinality

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Prevents high-cardinality tagging in StatsD/Datadog metrics to avoid cost explosions.

Core Features & Use Cases

  • Detects high-cardinality tag patterns in metric instrumentation and path-level code
  • Rejects risky metric calls and provides safe-tag guidance for developers
  • Example-driven: shows safe tagging conventions and low-cardinality alternatives

Quick Start

Enable this rule in your codebase to automatically flag high-cardinality metric calls and propose safe, low-cardinality alternatives.

Frequently Asked Questions about metrics-cardinality

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent high-cardinality tags in Datadog metrics from exploding costs?

High-cardinality tags in StatsD metrics cause metric explosions when unique values like IDs or timestamps create distinct time series. Limiting tags to predefined low-cardinality values prevents this cost spike while maintaining useful instrumentation.

How do I detect high-cardinality tag patterns in Ruby metric instrumentation?

Detect high-cardinality tag patterns in Ruby metric instrumentation by applying a rule-based workflow that scans .rb files for risky metric calls and blocks patterns matching dynamic values like UUIDs, emails, and timestamps.

What are the best low-cardinality alternatives for StatsD tagging in Ruby?

The best low-cardinality alternatives for StatsD tagging replace dynamic user IDs or emails with static attributes like environment, region, or request type, providing useful grouping dimensions without generating unbounded unique metric combinations.

Does this high-cardinality metric detection work with standard StatsD and Datadog integrations?

Yes, this high-cardinality metric detection targets standard StatsD and Datadog integrations by scanning Ruby projects for common metric calls and applying rules to block risky tags before they reach the metrics pipeline.

Why do high-cardinality tags cause metric explosions and how can I fix them?

High-cardinality tags cause metric explosions because each unique tag value generates a new time series. Fix them by implementing rules that reject dynamic values and enforce safe-tag recommendations for your metric instrumentation.