skills/monitoring-observability/SKILL.md
Comprehensive production monitoring, logging, tracing, alerting, SLI/SLO management, and observability patterns. Covers structured logging, distributed tracing, metrics collection, incident alerting, chaos engineering, and observability-as-code.
npx skillsauth add melikhanmutlu/web_ar monitoring-observabilityInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Patterns and best practices for making production systems observable and debuggable.
| Pillar | Purpose | Tools | |--------|---------|-------| | Logs | What happened (events) | Pino, Winston, Python logging | | Metrics | How much/how fast (numbers) | Prometheus, Datadog, CloudWatch | | Traces | Request flow across services | OpenTelemetry, Jaeger, Zipkin |
| Principle | Rule | |-----------|------| | Always structured | JSON format, never plain text in production | | Always contextual | Include requestId, userId, service name | | Never sensitive | No passwords, tokens, PII in logs | | Appropriate levels | ERROR=broken, WARN=degraded, INFO=business events, DEBUG=dev only |
| Level | When to Use | Example | |-------|-------------|---------| | ERROR | Something is broken, needs attention | DB connection failed, unhandled exception | | WARN | Degraded but functional | Retry succeeded, cache miss, slow query | | INFO | Business-significant events | User registered, order placed, deploy complete | | DEBUG | Development troubleshooting | Function input/output, state changes |
| Always Log | Never Log | |------------|-----------| | Request start/end with duration | Passwords or tokens | | Error with stack trace | Full credit card numbers | | Business events (signup, purchase) | PII without anonymization | | External API calls with latency | Health check successes (too noisy) | | Deployment events | Debug logs in production |
{
"timestamp": "2025-03-05T10:30:00.000Z",
"level": "error",
"service": "api",
"requestId": "req_abc123",
"userId": "usr_456",
"message": "Payment processing failed",
"error": {
"name": "PaymentError",
"message": "Card declined",
"code": "CARD_DECLINED"
},
"duration_ms": 1250,
"metadata": {
"provider": "stripe",
"amount": 9900
}
}
| Metric | What | Alert When | |--------|------|------------| | Rate | Requests per second | Sudden drop (outage) or spike (attack) | | Errors | Error rate (%) | > 1% of requests | | Duration | Latency (P50, P95, P99) | P95 > 2x normal |
| Metric | What | Alert When | |--------|------|------------| | Utilization | % resource in use | CPU > 80%, Memory > 85%, Disk > 90% | | Saturation | Queue depth, waiting | Queue growing, not draining | | Errors | Resource errors | Disk I/O errors, OOM kills |
| Metric | Purpose | |--------|---------| | Signups per hour | Growth monitoring | | Conversion rate | Business health | | Revenue per minute | Revenue monitoring | | Active users | Engagement tracking |
| Principle | Rule | |-----------|------| | Actionable | Every alert must have a runbook or clear action | | No noise | If you ignore it, it shouldn't be an alert | | Tiered severity | Page for critical, Slack for warning, email for info | | Include context | Alert must contain enough info to start investigating |
| Severity | Channel | Response Time | Example | |----------|---------|---------------|---------| | Critical | PagerDuty / Phone | < 5 min | Service down, data loss risk | | High | Slack #alerts | < 30 min | Error rate > 5%, high latency | | Warning | Slack #monitoring | < 4 hours | Disk 80%, slow queries | | Info | Dashboard only | Next business day | Deployment complete |
| Anti-Pattern | Problem | |-------------|---------| | Alert on every error | Alert fatigue, people ignore | | No runbook | Responder doesn't know what to do | | Alert on symptom only | Need to understand cause | | Static thresholds only | Misses anomalies, triggers on normal variation |
| Type | Purpose | Frequency | |------|---------|-----------| | Liveness | "Is the process running?" | Every 10s | | Readiness | "Can it serve traffic?" | Every 5s | | Startup | "Has it finished initializing?" | During boot | | Deep health | "Are all dependencies OK?" | Every 30s |
{
"status": "healthy",
"version": "1.2.3",
"uptime_seconds": 86400,
"checks": {
"database": { "status": "healthy", "latency_ms": 5 },
"redis": { "status": "healthy", "latency_ms": 2 },
"external_api": { "status": "degraded", "latency_ms": 1500 }
}
}
| Scenario | Need Tracing? | |----------|--------------| | Single service | Usually no, logs sufficient | | 2-3 services | Helpful for debugging | | Microservices (4+) | Essential | | Async workflows | Essential |
Client -> API Gateway -> Auth Service -> User Service -> Database
| | | | |
trace_id: abc-123 (same across all services)
span_id: unique per service call
| Dashboard | Contents | |-----------|----------| | Service Overview | Request rate, error rate, latency (RED) | | Infrastructure | CPU, memory, disk, network (USE) | | Business | Signups, conversions, revenue | | Deployment | Deploy frequency, rollback rate, lead time |
| Need | Self-Hosted | Managed | |------|-------------|---------| | Logging | ELK Stack, Loki | Datadog, Logtail | | Metrics | Prometheus + Grafana | Datadog, CloudWatch | | Tracing | Jaeger, Tempo | Datadog, Honeycomb | | Alerting | Alertmanager | PagerDuty, OpsGenie | | All-in-one | Grafana Stack | Datadog, New Relic | | Error tracking | Sentry (self-host) | Sentry, Bugsnag |
Service Level Indicators (SLIs) are quantitative measures of service behavior. Define them based on user-facing behavior.
| SLI Type | Measurement | Example | |----------|-------------|---------| | Availability | Successful requests / total requests | 99.9% of requests return non-5xx | | Latency | % requests faster than threshold | 95% of requests < 200ms | | Quality | % responses that are correct/complete | 99.5% of responses have full data | | Throughput | Sustained request handling rate | Sustains 10K req/s without degradation |
| Step | Action | |------|--------| | 1. Identify user journeys | Map critical paths users take | | 2. Define SLIs per journey | Pick measurable indicators | | 3. Set targets with stakeholders | Align reliability goals with business | | 4. Calculate error budgets | 100% - SLO = error budget | | 5. Build burn-rate alerts | Alert when budget consumed too fast |
SLO: 99.9% availability
Error Budget: 0.1% = 43.2 minutes/month
Burn Rate Alert Thresholds:
- 14.4x burn rate → Page (budget gone in 1 hour)
- 6x burn rate → Ticket (budget gone in 2.5 days)
- 1x burn rate → Dashboard review
| Component | Purpose | |-----------|---------| | Receivers | Ingest telemetry (OTLP, Jaeger, Prometheus) | | Processors | Transform, filter, batch, sample | | Exporters | Send to backends (Jaeger, Prometheus, Datadog) |
| Approach | When to Use | |----------|------------| | Auto-instrumentation | Quick start, standard frameworks | | Manual instrumentation | Custom business logic, specific spans | | SDK instrumentation | Libraries and shared components |
| Strategy | Use Case | |----------|----------| | Head-based | Simple, predictable sampling rate | | Tail-based | Keep interesting traces (errors, slow) | | Priority-based | Always sample critical paths |
| Layer | What to Monitor | Tools | |-------|----------------|-------| | Cluster | Node health, resource utilization | Prometheus Operator, kube-state-metrics | | Pod | Container CPU/memory, restarts | cAdvisor, kubelet metrics | | Application | Custom metrics, request rates | OTel SDK, Prometheus client libraries | | Network | Service mesh telemetry, DNS | Istio/Envoy metrics, CoreDNS |
| Provider | Native Tools | Integration | |----------|-------------|-------------| | AWS | CloudWatch, X-Ray | CloudWatch exporter for Prometheus | | GCP | Cloud Monitoring, Cloud Trace | Stackdriver integration | | Azure | Monitor, App Insights | Azure Monitor exporter |
| Database | Key Metrics | |----------|-------------| | PostgreSQL | Active connections, query duration, dead tuples, replication lag | | Redis | Memory usage, hit rate, connected clients, evictions | | MongoDB | Op counters, document metrics, replication lag |
| Phase | Action | |-------|--------| | 1. Hypothesize | Define expected system behavior under failure | | 2. Inject fault | Use Chaos Monkey, Gremlin, or Litmus | | 3. Observe | Monitor dashboards and alerts during experiment | | 4. Learn | Document findings, improve resilience |
| Experiment | What It Tests | |------------|--------------| | Kill pod/instance | Auto-recovery and failover | | Network partition | Service isolation and graceful degradation | | Latency injection | Timeout handling and circuit breakers | | Disk fill | Storage alerts and cleanup procedures | | DNS failure | Fallback resolution and caching |
| Practice | Guideline | |----------|-----------| | Rotation length | 1 week, with handoff documentation | | Escalation policy | Primary -> Secondary -> Manager (15 min each) | | Fatigue prevention | Max 2 pages/night, compensatory time off | | Runbook automation | Auto-remediation for known issues |
| Technique | How | |-----------|-----| | Grouping | Cluster related alerts by service/component | | Deduplication | Suppress identical alerts within a window | | Intelligent routing | Route based on service ownership | | ML-based clustering | Auto-group anomalous patterns |
| Tool | Use Case | |------|----------| | Terraform | Provision monitoring infrastructure (Prometheus, Grafana) | | Ansible | Deploy and configure monitoring agents | | Helm charts | Kubernetes monitoring stack deployment |
| Strategy | Impact | |----------|--------| | Sampling | Reduce trace/log volume by 80-90% with tail-based sampling | | Tiered storage | Hot (7d) -> Warm (30d) -> Cold (1yr) for metrics/logs | | Retention policies | Auto-delete debug logs after 7 days | | Cardinality control | Limit label combinations to avoid metric explosion | | Right-sizing | Match monitoring infra to actual load |
| Standard | Monitoring Requirements | |----------|------------------------| | SOC2 | Audit logs, access tracking, change detection | | PCI DSS | Log all access to cardholder data, 1-year retention | | HIPAA | PHI access logging, encryption monitoring | | GDPR | Data access auditing, right-to-erasure tracking |
| Capability | Application | |------------|-------------| | Anomaly detection | Statistical models and ML to detect unusual patterns | | Predictive analytics | Forecast capacity needs and potential failures | | Root cause analysis | Correlation analysis and pattern recognition | | Intelligent clustering | Auto-group alerts to reduce noise | | Time-series forecasting | Proactive scaling and maintenance scheduling | | Log analysis with NLP | Categorize and extract insights from log text |
tools
# AI Marketing Suite — Main Orchestrator You are a comprehensive AI marketing analysis and content generation system for Claude Code. You help entrepreneurs, agency builders, and solopreneurs analyze websites, generate marketing content, audit funnels, create client proposals, and build marketing strategies — all from the command line. ## Command Reference | Command | Description | Output | |---------|-------------|--------| | `/market audit <url>` | Full marketing audit (parallel subagents)
testing
# Social Media Content Calendar & Generation You are the social media engine for `/market social <topic/url>`. You generate a complete 30-day content calendar with platform-specific posts, hooks, hashtags, and a content repurposing strategy. Every post is ready to publish or hand to a social media manager. ## When This Skill Is Invoked The user runs `/market social <topic/url>`. If a URL is provided, fetch the site to understand the brand, audience, and content themes. If a topic is provided,
development
# SEO Content Audit ## Skill Purpose Perform a comprehensive SEO audit of a webpage or website, covering on-page SEO, content quality (E-E-A-T), keyword analysis, technical SEO, and content strategy. This skill combines automated analysis via `scripts/analyze_page.py` with expert-level manual review to produce an actionable SEO audit document. ## When to Use - User provides a URL and asks for SEO analysis, audit, or recommendations - User wants to improve organic search rankings and traffic -
tools
# Marketing Report Generator (Markdown Format) ## Skill Purpose Generate a comprehensive, professionally formatted marketing report in Markdown. This skill compiles data from all previous audit and analysis results into a single, client-ready document with scores, findings, recommendations, and a prioritized action plan with revenue impact estimates. ## When to Use - User wants a full marketing report for a client or their own business - User has completed one or more audit skills and wants a