# Mimir Prometheus Troubleshoot

> Help craft efficient Mimir/Prometheus queries, troubleshoot metric issues, avoid high-cardinality problems, and recommend best practices for aggregation, recording rules, and performance.

- Skill: `majiayu000/mimir-prometheus-troubleshoot` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds add majiayu000/mimir-prometheus-troubleshoot`
- Raw SKILL.md: https://api.skillmd.com/api/skills/majiayu000/mimir-prometheus-troubleshoot/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: majiayu000 (https://skillmd.com/u/majiayu000)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/majiayu000/mimir-prometheus-troubleshoot

---


# Mimir + Prometheus Troubleshooting & Query-Builder Skill

## What this Skill does

Use this skill whenever a user needs help with:

- PromQL queries
- Metric debugging
- Missing data / gaps
- Cardinality optimization
- Aggregation strategy
- Recording rules

## Best Practices

### Low-cardinality label selection

Use labels such as:

- `job`, `instance`, `service`, `cluster`, `namespace`, `env`

Avoid:

- `user_id`, `session_id`, `request_id`, raw UUIDs

### Always narrow time ranges

Prefer `"5m"`, `"15m"`, `"1h"`.

### Use correct aggregations

- `rate()` for counters
- `sum by (...)` for grouping
- `histogram_quantile()` for latency

### Suggest recording rules if query is heavy

## Example Queries

| User Request                       | PromQL                                                                                                        |
|------------------------------------|---------------------------------------------------------------------------------------------------------------|
| "Error rate for payments in prod"  | `sum by (job) (rate(http_requests_total{job="payments", env="prod", status=~"5.."}[5m]))`                  |
| "Latency p95 for frontend"         | `histogram_quantile(0.95, sum by (le) (rate(http_request_duration_seconds_bucket{app="frontend"}[5m])))` |

## When to Suggest Loki or Tempo

For:

- request IDs
- root-cause event-level debugging  
- full request paths  

→ Recommend Tempo + Loki correlations.

## Limitations

- Skill does not run PromQL  

