monitoring-and-alerting
Use when setting up or debugging Prometheus, Grafana, logging, or alerting
Works with
---
name: monitoring-and-alerting
description: Use when setting up or debugging Prometheus, Grafana, logging, or alerting
license: MIT
---
# Monitoring & Alerting
## Mode Detection
- **Repo mode** — templates in `tooling/monitoring/`. Scaffold scrape configs, dashboards, alert rules.
- **Chat mode** — user pastes metrics, alert config, or dashboard JSON. Review and suggest fixes.
## Prometheus
### Key concepts
- **Scrape config** — defines where Prometheus pulls metrics from
- **Alert rules** — conditions that trigger alerts
- **Recording rules** — precomputed expensive queries
### Useful PromQL queries
```promql
# CPU usage by pod
rate(container_cpu_usage_seconds_total[5m])
# Memory usage
container_memory_working_set_bytes / container_spec_memory_limit_bytes
# HTTP error rate
rate(http_requests_total{status=~"5.."}[5m]) / rate(http_requests_total[5m])
# Pod restarts
increase(kube_pod_container_status_restarts_total[1h])
```
### Alerting rules example
```yaml
groups:
- name: app-alerts
rules:
- alert: HighErrorRate
expr: rate(http_requests_total{status=~"5.."}[5m]) > 0.05
for: 5m
labels:
severity: critical
annotations:
summary: "High error rate on {{ $labels.service }}"
```
## Grafana
### Debugging dashboards
- Check data source connection: Configuration → Data Sources → Test
- Check query in Explore tab before adding to panel
- Check time range — many "missing data" issues are time range mismatches
## Logging
### What good logs look like
```json
{
"timestamp": "2026-04-01T10:00:00Z",
"level": "error",
"message": "Database connection failed",
"service": "api",
"trace_id": "abc123",
"error": "connection refused"
}
```
### Log querying
```bash
# Kubernetes logs
kubectl logs -l app=myapp --since=1h
kubectl logs -l app=myapp --tail=100
# Journald
journalctl -u myservice -f
journalctl -u myservice --since "1 hour ago"
```
## Tooling Templates
- `tooling/monitoring/prometheus/` — scrape configs, alert rules
- `tooling/monitoring/grafana/` — dashboard JSONs
- `tooling/monitoring/starters/` — full observability stackMore Observability skills
google-agents-cli-observability
google/agents-cli
>
azure-observability
microsoft/azure-skills
Azure Observability Services including Azure Monitor, Application Insights, Log Analytics, Alerts, and Workbooks. Provides metrics, APM, distributed tracing, KQL queries, and interactive reports. USE FOR: Azure Monitor, Application Insights, Log Analytics, Alerts, Workbooks, metrics, APM, distributed tracing, KQL queries, interactive reports, observability, monitoring dashboards. DO NOT USE FOR: instrumenting apps with App Insights SDK (use appinsights-instrumentation), querying Kusto/ADX clusters (use azure-kusto), cost analysis (use azure-cost-optimization).
social
coreyhaines31/marketingskills
When the user wants help creating, scheduling, or optimizing social media content for LinkedIn, Twitter/X, Instagram, TikTok, Facebook, or other platforms, or wants to do social listening and engagement triage. Also use when the user mentions 'LinkedIn post,' 'Twitter thread,' 'social media,' 'content calendar,' 'social scheduling,' 'engagement,' 'viral content,' 'what should I post,' 'repurpose this content,' 'tweet ideas,' 'LinkedIn carousel,' 'social media strategy,' 'grow my following,' 'TikTok video,' 'Reels,' 'Shorts,' 'video script,' 'video hook,' 'short-form video,' 'create a reel,' 'social listening,' 'brand mentions,' 'competitor monitoring,' 'top posts to comment on,' 'find people asking for,' 'carousel,' 'slide-by-slide,' or 'document post.' Use this for social media content creation, repurposing, scheduling, short-form video scripting, and social listening. For broader content strategy, see content-strategy. For paid ads, see ad-creative. For earned media, see public-relations.

