metrics-analysis

Query Prometheus metrics and Grafana dashboards using PromQL for incident investigation.

Updated Mar 26, 2026
One-click install
npx skills add https://github.com/erwinv2k-TKG/AgentesVSC --skill metrics-analysis-erwinv2k-tkg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: metrics-analysis
Source: https://github.com/erwinv2k-TKG/AgentesVSC/tree/main/packs/incidentfox/sre-agent/.claude/skills/metrics-analysis
Command: npx skills add https://github.com/erwinv2k-TKG/AgentesVSC --skill metrics-analysis-erwinv2k-tkg

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires httpx, and includes scripts (resource) components.

What problem does it solve? Investigating latency spikes, error rates, and resource saturation requires writing correct PromQL queries and navigating Grafana manually, which slows down incident response and root cause analysis. ## Core Features & Use Cases - PromQL Query Execution: Run instant and range PromQL queries against Prometheus with formatted or JSON output. - Grafana Discovery: List and search dashboards, and retrieve firing alerts filtered by state (alerting, pending, ok). - Structured Investigation Workflows: Built-in USE/RED method guidance with step-by-step recipes for latency, error rate, and CPU/memory investigations. - Use Case: During an incident where API latency spiked, run a p95 histogram_quantile query broken down by endpoint, then check firing Grafana alerts to correlate the degradation with a recent deployment. ## Quick Start Ask the agent to investigate why the api service p95 latency increased over the last hour using Prometheus metrics.

Frequently Asked Questions about metrics-analysis

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

FAQPage Schema
How do I query Prometheus metrics with PromQL from Python?

Run the query_prometheus.py script with a --query flag containing your PromQL expression, optionally adding --time-range in minutes for range queries. Results print in formatted text or JSON via the --json flag.

How do I check which Grafana alerts are currently firing?

Run get_alerts.py with --state alerting to list only firing alerts, grouped by state with dashboard and panel references. Omit the flag to see alerts in all states including pending, ok, and paused.

What is the difference between rate() and increase() in PromQL?

rate() calculates the per-second average increase of a counter over a time range, while increase() returns the total increase over that range. Both require a range vector like [5m] and should be used instead of comparing raw counter values.

Why does histogram_quantile return no data for my latency query?

histogram_quantile only works with histogram _bucket metrics combined with rate(), such as rate(http_request_duration_seconds_bucket[5m]). Using it on summary metrics or gauges produces empty or incorrect results.

Do I need to set GRAFANA_API_KEY before running the scripts?

No, credentials are injected automatically by the IncidentFox credential proxy layer. The scripts also support bearer tokens, basic auth, and tenant headers as fallback authentication methods.