infra-prometheus-optimization

Diagnose Prometheus cardinality issues and optimize recording rules, remote write, and AlertManager routing.

14|1|Updated May 5, 2026
One-click install
npx skills add https://github.com/ivanshamaev/de-agent-skills --skill infra-prometheus-optimization
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: infra-prometheus-optimization
Source: https://github.com/ivanshamaev/de-agent-skills/tree/main/group_skills/infra_dataops_group_skills/infra_prometheus_optimization
Command: npx skills add https://github.com/ivanshamaev/de-agent-skills --skill infra-prometheus-optimization

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Prometheus setups degrade over time due to high cardinality, inefficient queries, overloaded remote write, and noisy alerting, causing storage bloat, performance issues, and operational fatigue.

Core Features & Use Cases

  • Cardinality explosion diagnosis to identify metrics and label pairs with excessive series growth using TSDB status endpoints, then verify impact with PromQL.
  • Recording rules using level:metric:operations naming to precompute expensive dashboard queries and standardize metric computation for faster panels and consistent alert logic.
  • AlertManager tuning for routing and inhibition using routing trees to send critical incidents to the right receivers, apply inhibition to prevent alert storms, and use absent() to detect missing scrape targets.
  • Storage and ingest efficiency controls via scrape interval tuning, relabeling/metric relabeling to drop expensive labels and metrics, and remote write configuration for Prometheus → Thanos/Mimir long-term retention.

Quick Start

Use the infra-prometheus-optimization skill to diagnose high-cardinality series, add recording rules for your slow dashboards, and tune remote write and alert routing based on your current Prometheus and AlertManager configuration.

Frequently Asked Questions about infra-prometheus-optimization

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

FAQPage Schema
How do I diagnose and fix high cardinality issues in Prometheus?

Diagnose Prometheus high cardinality by analyzing TSDB status endpoints to identify metrics and label pairs with excessive series growth, then verify the impact using PromQL. Fix the issue by applying scrape relabeling and metric relabeling to drop expensive labels and metrics, reducing storage bloat and query load.

What is the standard naming convention for Prometheus recording rules?

The standard naming convention for Prometheus recording rules is level:metric:operations. This format precomputes expensive dashboard queries and standardizes metric computation, resulting in faster dashboard panels and consistent alert logic across your observability stack.

How do I configure AlertManager routing and inhibition to prevent alert storms?

Configure AlertManager routing and inhibition by building routing trees to send critical incidents to the correct receivers. Apply inhibition rules to suppress redundant alerts and use absent() alerting to detect missing scrape targets, preventing alert storms and reducing operational fatigue.

How do I tune Prometheus remote write queues for Thanos and Mimir long-term retention?

Tune Prometheus remote write queues for Thanos and Mimir by configuring remote_write queue parameters and write relabeling rules. This optimizes data ingest efficiency for long-term retention architectures, preventing remote write overloads and stabilizing production monitoring.

Can I use this approach to reduce storage and query load in my existing observability stack?

Yes, you can reduce Prometheus storage and query load by tuning scrape intervals, applying relabeling strategies to drop expensive metrics, and standardizing recording rules. These optimizations directly address storage bloat and performance degradation in existing production setups.

Why does my Prometheus setup degrade over time and cause operational fatigue?

Prometheus setups degrade over time due to high cardinality, inefficient queries, overloaded remote write, and noisy alerting. These factors cause storage bloat, performance issues, and operational fatigue, requiring optimization of scrape relabeling, recording rules, and AlertManager routing.