monitoring-patternslisted
Install: claude install-skill ku5ic/dotfiles
# Monitoring Patterns
## When to load this skill
- Python project with `from prometheus_client import` or `import prometheus_client`
- User asks about Prometheus, metrics, counters, histograms, or observability
- User is implementing health check endpoints
- User asks about monitoring, alerting, or instrumenting code
## When not to load this skill
- Infrastructure Prometheus configuration (scrape configs, alert rules, recording rules)
- Grafana dashboard design
- OpenTelemetry tracing (separate domain)
---
## Prometheus metric types
| Type | When to use | Goes down? |
| --------- | ------------------------------------------------------------- | ---------- |
| Counter | Requests, errors, bytes processed - totals that only increase | No |
| Gauge | Queue depth, active connections, memory usage - current state | Yes |
| Histogram | Request duration, response size - distribution matters | No |
| Summary | Like Histogram but computes quantiles client-side | No |
Use **Histogram** over Summary by default. Summary quantiles are computed in the client and cannot be aggregated across instances. Histogram buckets are server-side and aggregatable.
---
## prometheus-client
```bash
pip install prometheus-client
```
### Counter
Tracks cumulative values that only increase.
```python
from prometheus_client import Counter
REQUESTS = Counter(
"http_requests_total"