victoriametrics-unused-metrics-analysis

Identify unused VictoriaMetrics metrics via the metric_names_stats API and propose drop or relabeling actions.

45|4|Updated Mar 4, 2026
One-click install
npx skills add https://github.com/VictoriaMetrics/skills --skill victoriametrics-unused-metrics-analysis
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: victoriametrics-unused-metrics-analysis
Source: https://github.com/VictoriaMetrics/skills/tree/main/plugins/diagnostics/skills/victoriametrics-unused-metrics-analysis
Command: npx skills add https://github.com/VictoriaMetrics/skills --skill victoriametrics-unused-metrics-analysis

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Find unused and rarely-queried metrics in VictoriaMetrics using the metric_names_stats API, then suggest optimization actions (drop rules, relabel configs). Use this skill when the user wants to find unused metrics, identify wasted storage, optimize metric ingestion, reduce cardinality by dropping unneeded metrics, clean up scrape targets, or asks about which metrics are never queried. Also trigger when the user mentions "metric cleanup", "unused series", "what metrics can I drop", "metric optimization", "wasted ingestion", or wants to reduce VictoriaMetrics resource consumption by eliminating unnecessary metrics.

Core Features & Use Cases

  • Identify metrics with queryRequests: 0 and lastRequestTimestamp to determine truly unused metrics
  • Group unused metrics by prefix and provide precise counts per specific metric names to enable safe drops
  • Recommend concrete actions for removal or relabeling (vmagent relabel_configs, or -relabelConfig) and caution about dependencies with dashboards/alerts

Quick Start

Run the skill to identify unused and rarely queried metrics in your VictoriaMetrics deployment and receive actionable optimization steps.

Frequently Asked Questions about victoriametrics-unused-metrics-analysis

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

FAQPage Schema
How do I find unused metrics in VictoriaMetrics to reduce storage and ingestion costs?

You can find unused VictoriaMetrics metrics by querying the metric_names_stats API for series with zero query requests and old lastRequestTimestamp values, then dropping them via vmagent relabel_configs to reduce storage and ingestion costs.

What is metric cardinality optimization and when do I need it for Prometheus-compatible monitoring?

Metric cardinality optimization identifies and removes rarely queried or unused time-series in Prometheus-compatible systems to reduce wasted ingestion. You need it when storage costs rise or scrape targets generate excessive unqueried metric data.

How do I configure vmagent relabel_configs to drop unused metrics by prefix?

Group unused metrics by prefix using metric_names_stats output, then apply vmagent relabel_configs or the -relabelConfig flag to drop matching metric names. This ensures only actively queried series are ingested going forward.

Does the VictoriaMetrics metric_names_stats API work with standard Prometheus metric names?

Yes, the metric_names_stats API targets standard Prometheus-compatible metric names. It analyzes usage across prefixes and filters to truly unused metrics, supporting workflow scenarios including dashboards, alerts, and recording rules.

What are the limitations of dropping unused metrics based on queryRequests counts?

Dropping unused metrics requires caution because series with zero queryRequests might still have dependencies with dashboards, alerts, or recording rules. Always verify that truly unused metrics have no downstream workflow dependencies before removal.