metrics-collector

Validate Prometheus metric registration, labels, and cardinality in metrics-collector.js changes.

Updated Sep 2, 2025
One-click install
npx skills add https://github.com/thefixer3x/onasis-gateway --skill metrics-collector
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: metrics-collector
Source: https://github.com/thefixer3x/onasis-gateway/tree/main/.claude/skills/metrics-collector
Command: npx skills add https://github.com/thefixer3x/onasis-gateway --skill metrics-collector

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill prevents accidental corruption of Prometheus metrics by enforcing strict rules on metric names, labels, cardinality, and emission patterns when modifying the metrics collector.

Core Features & Use Cases

  • Metric Name Preservation: Ensures existing Prometheus metric names are not removed or renamed.
  • Label Stability: Guarantees that labels on existing metrics remain unchanged and new required labels are not added.
  • Cardinality Control: Prevents the introduction of unbounded cardinality labels, which can overload monitoring systems.
  • Use Case: When a developer needs to add a new metric to track API gateway request latency, they would use this skill to ensure the new metric adheres to all established naming conventions, label usage, and cardinality limits.

Quick Start

Use the metrics-collector skill to review proposed changes to the metrics collector logic.

Frequently Asked Questions about metrics-collector

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

FAQPage Schema
How do I prevent unbounded cardinality labels when adding new Prometheus metrics?

To prevent unbounded cardinality labels in Prometheus metrics, you must enforce guardrails that validate metric registration and label value formats before emission. This strictly controls label stability and prevents monitoring system overload.

Why does changing a Prometheus metric name break my monitoring dashboards?

Changing a Prometheus metric name breaks monitoring dashboards because existing queries rely on exact name consistency. Enforcing metric name preservation during modifications ensures established monitoring best practices are maintained without data loss.

How do I add a new metric to track API gateway request latency safely?

To safely add a metric tracking API gateway request latency, validate the new metric registration against established naming conventions, verify label usage, and check cardinality limits to ensure adherence to monitoring rules.

What are the limitations of modifying a metrics collector without guardrails?

Modifying a metrics collector without guardrails risks accidental corruption of Prometheus metrics by allowing unbounded cardinality, removing required labels, or altering metric names, which severely degrades observability and system stability.

Does this validation process check for event emission and error type classification?

Yes, the validation process requires strict validation of event emission and error type classification alongside metric registration and label value formats to maintain Prometheus metric integrity during collector modifications.