monitoring-apis
Installation
SKILL.md
Monitoring APIs
Overview
Build real-time API monitoring with metrics collection (request rate, latency percentiles, error rates), health check endpoints, and alerting rules. Instrument API middleware to emit Prometheus metrics or StatsD counters, configure Grafana dashboards with SLO tracking, and implement synthetic monitoring probes for uptime verification.
Prerequisites
- Prometheus + Grafana stack, or Datadog/New Relic/CloudWatch for metrics and dashboards
- Metrics client library:
prom-client(Node.js),prometheus_client(Python), or Micrometer (Java) - Alerting channel configured: PagerDuty, Slack webhook, or email for alert routing
- Structured logging library: Winston, Pino (Node.js), structlog (Python), or Logback (Java)
- Synthetic monitoring tool: Checkly, Uptime Robot, or custom cron-based health probes
Instructions
- Examine existing middleware and logging setup using Grep and Read to identify current observability coverage and gaps.
- Implement metrics middleware that records per-request data:
http_request_duration_secondshistogram (with method, path, status labels),http_requests_totalcounter, andhttp_requests_in_flightgauge. - Create a
/healthendpoint returning structured health status including dependency checks (database connectivity, cache availability, external service reachability) with response time for each. - Add a
/readyendpoint separate from health that returns 503 during startup initialization and graceful shutdown, for load balancer integration.
Related skills