Agent Skills
› cosmicstack-labs/mercury-agent-skills
› monitoring-observability
monitoring-observability
GitHub构建系统可观测性,涵盖Prometheus指标、Loki日志、Jaeger链路追踪及Alertmanager告警。遵循Google SRE黄金信号与RED/USE模型设计Grafana看板,规范告警分级响应,实施SLO监控与最佳实践以确保系统稳定性。
Trigger Scenarios
需要搭建或优化监控系统时
配置Prometheus/Grafana/Loki/Jaeger等工具时
定义告警规则与响应策略时
设计可观测性看板时
Install
npx skills add cosmicstack-labs/mercury-agent-skills --skill monitoring-observability -g -y
SKILL.md
Frontmatter
{
"name": "monitoring-observability",
"metadata": {
"tags": [
"monitoring",
"observability",
"prometheus",
"grafana",
"logging",
"tracing"
],
"author": "cosmicstack-labs",
"version": "1.0.0",
"category": "devops"
},
"description": "Prometheus, Grafana, ELK\/Loki, Jaeger, metrics, logging, tracing, and alerting"
}
Monitoring & Observability
Build comprehensive observability for your systems.
The Three Pillars
1. Metrics (Prometheus)
# Instrument your app
http_requests_total{method="GET", endpoint="/api/users", status="200"} 1024
http_request_duration_seconds{quantile="0.95"} 0.235
2. Logging (Loki / ELK)
- Structured JSON logging
- Include: timestamp, level, service, trace_id, message
- Centralized log aggregation
- Log levels: DEBUG < INFO < WARN < ERROR < FATAL
3. Tracing (Jaeger / Tempo)
- Trace every request across services
- Span: individual operation with timing
- Distributed context propagation via trace ID headers
- Sample 1-10% of production traffic
Alerting (Alertmanager)
Alert Severity
| Severity | Response Time | Channel |
|---|---|---|
| Critical | Immediately | PagerDuty + SMS |
| Warning | 1 hour | Slack + Email |
| Info | Next day | Dashboard |
Golden Signals (Google SRE)
- Latency: Time to respond
- Traffic: Requests per second
- Errors: Error rate (5xx, exceptions)
- Saturation: Resource utilization
Dashboard Design (Grafana)
Rules
- 3-5 panels per row
- Time series with trend lines, not raw numbers
- RED metrics: Rate, Errors, Duration per service
- USE metrics: Utilization, Saturation, Errors per resource
- Include annotations for deployments, incidents
Best Practices
- Monitor from outside (synthetic checks)
- Monitor everything, alert on what matters
- Use SLOs to define what's "good enough"
- Test alerts (fire drills, tabletop exercises)
- Review dashboards monthly with the team
Version History
- 38e2523 Current 2026-07-05 19:39


