tsuga-right-size-metric-cardinality

Reduce high-cardinality OpenTelemetry metric attributes by moving values to span attributes, log fields, or SDK metric views.

2|Updated May 28, 2026
One-click install
npx skills add https://github.com/tsuga-dev/agent-plugins --skill tsuga-right-size-metric-cardinality
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: tsuga-right-size-metric-cardinality
Source: https://github.com/tsuga-dev/agent-plugins/tree/main/plugins/telemetry/skills/tsuga-right-size-metric-cardinality
Command: npx skills add https://github.com/tsuga-dev/agent-plugins --skill tsuga-right-size-metric-cardinality

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

High-cardinality metric labels create too many time series, which drives storage costs up and can degrade query/dashboard performance.

Core Features & Use Cases

  • Diagnose the offending label: Uses audit output like tsuga-audit-metrics to pinpoint the attribute causing a cardinality explosion, then confirms the count with Tsuga aggregations.
  • Choose the right signal placement: Selects whether the value belongs on a span attribute, a structured log field, or via an SDK metric view to preserve the metric while reducing dimensions.
  • Apply changes safely: Enforces a mutation gate with explicit user confirmation, checks downstream monitors/dashboards for breakage risk, and recommends verification via tsuga-smoke-test and tsuga-audit-metrics after deploy.

Quick Start

Use the tsuga-right-size-metric-cardinality skill to refactor a high-cardinality metric attribute by moving it to the correct signal or dropping/bucketing it with an SDK metric view after confirming the downstream impact.

Frequently Asked Questions about tsuga-right-size-metric-cardinality

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

FAQPage Schema
How do I fix high-cardinality OpenTelemetry metrics causing excessive time series?▼

Fix high-cardinality OpenTelemetry metrics by reducing unique attribute combinations, such as moving user_id or request_id to span attributes, structured logs, or dropping them via SDK metric views to prevent time series explosions.

What causes a metric cardinality explosion in OpenTelemetry observability pipelines?▼

A metric cardinality explosion occurs when high-cardinality attributes like user_id or request_id generate excessive unique time series, driving up storage costs and degrading dashboard query performance in production observability environments.

How do I move high-cardinality metric labels to span attributes or log fields?▼

Identify the offending metric attribute through an audit, confirm the unique count with aggregations, and relocate the high-cardinality value to a span attribute or structured log field to preserve observability without inflating metric time series.

Can I use SDK metric views to drop or bucket high-cardinality OpenTelemetry metric attributes?▼

Yes, SDK metric views can drop or bucket high-cardinality metric attributes, allowing you to reduce dimensional combinations while retaining the core metric signal in production services.

What is the best way to safely refactor OpenTelemetry metrics without breaking dashboards?▼

Safely refactor metrics by enforcing a mutation gate with explicit confirmation, checking downstream monitors and dashboards for breakage risk, and verifying the change by re-running metric audits after deployment.

When should I not use SDK metric views to reduce metric cardinality?▼

Avoid using SDK metric views when the high-cardinality attribute is essential for the metric itself, as dropping or bucketing it may remove critical dimensional context needed by downstream dashboards and monitors.