monitoring-apis
Implements API health checks, metrics, and dashboards to track performance and SLOs.
Install
mkdir -p .claude/skills/monitoring-apis && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/5983" && unzip -o skill.zip -d .claude/skills/monitoring-apis && rm skill.zipInstalls to .claude/skills/monitoring-apis
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Build real-time API monitoring dashboards with metrics, alerts, andKey capabilities
- →Instrument API middleware to emit Prometheus metrics or StatsD counters
- →Configure Grafana dashboards with SLO tracking
- →Implement synthetic monitoring probes for uptime verification
- →Create a /health endpoint returning structured health status
- →Define alerting rules for error rates and latency
- →Add SLO tracking with error budget calculation
How it works
This skill instruments API middleware to collect per-request data like duration, error rates, and in-flight requests. It also configures health and readiness endpoints, Grafana dashboards, and alerting rules.
Inputs & outputs
When to use monitoring-apis
- →Setting up API health endpoints
- →Implementing Prometheus middleware
- →Configuring Grafana dashboards
- →Creating alert rules for SLO breaches
About this skill
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. - Configure histogram buckets aligned with SLO targets: [0.01, 0.05, 0.1, 0.25, 0.5, 1, 2.5, 5, 10] seconds for comprehensive latency distribution.
- Build Grafana dashboard panels: request rate (QPS), p50/p95/p99 latency, error rate percentage, active connections, and per-endpoint breakdown.
- Define alerting rules: error rate > 5% for 5 minutes (critical), p99 latency > 2s for 10 minutes (warning), health check failure for 3 consecutive probes (critical).
- Implement synthetic monitoring that sends periodic requests to critical endpoints from external locations, measuring availability and latency from the consumer perspective.
- Add SLO tracking with error budget calculation: define SLO (99.9% availability, p95 < 500ms), compute burn rate, and alert when error budget consumption exceeds projected pace.
See ${CLAUDE_SKILL_DIR}/references/implementation.md for the full implementation guide.
Output
${CLAUDE_SKILL_DIR}/src/middleware/metrics.js- Prometheus metrics collection middleware${CLAUDE_SKILL_DIR}/src/routes/health.js- Health check and readiness endpoints${CLAUDE_SKILL_DIR}/monitoring/dashboards/- Grafana dashboard JSON definitions${CLAUDE_SKILL_DIR}/monitoring/alerts/- Alerting rule definitions (Prometheus AlertManager or Grafana)${CLAUDE_SKILL_DIR}/monitoring/synthetic/- Synthetic monitoring probe scripts${CLAUDE_SKILL_DIR}/monitoring/slo.yaml- SLO definitions and error budget configuration
Error Handling
| Error | Cause | Solution |
|---|---|---|
| Metrics cardinality explosion | High-cardinality labels (user ID, request ID) on metrics | Use bounded label values only (method, status code, endpoint group); aggregate user-level data in logs |
| Health check false positive | Health endpoint returns 200 but dependent service is degraded | Include dependency checks with individual status; use structured response with degraded state |
| Alert fatigue | Too many low-severity alerts firing during normal operations | Tune alert thresholds using historical baselines; implement alert grouping and deduplication |
| Dashboard data gap | Metrics not collected during deployment rollout window | Configure Prometheus scrape interval < deployment duration; use push-based metrics during deploys |
| SLO miscalculation | Error budget calculation uses wrong time window or includes planned maintenance | Exclude maintenance windows from SLO calculation; align window with business reporting period |
Refer to ${CLAUDE_SKILL_DIR}/references/errors.md for comprehensive error patterns.
Examples
RED method dashboard: Request rate, Error rate, and Duration panels per endpoint, with drill-down from overview to individual endpoint detail, including top-10 slowest endpoints by p99.
SLO-based alerting: Define 99.9% availability SLO with 30-day rolling window, alert when 1-hour burn rate exceeds 14.4x (consuming daily error budget in 1 hour), with PagerDuty escalation.
Dependency health matrix: Dashboard showing real-time health status of all downstream dependencies (database, cache, external APIs) with latency sparklines and circuit breaker state indicators.
See ${CLAUDE_SKILL_DIR}/references/examples.md for additional examples.
Resources
- Google SRE Book: Monitoring Distributed Systems chapter
- Prometheus documentation: https://prometheus.io/docs/
- Grafana dashboards: https://grafana.com/docs/grafana/latest/
- USE Method and RED Method for metrics design
Prerequisites
Limitations
- →Metrics cardinality explosion from high-cardinality labels
- →Health check false positives when dependent services are degraded
- →Alert fatigue from too many low-severity alerts
How it compares
This workflow automates the setup of detailed API monitoring, including SLO tracking and synthetic probes, which is more extensive than manual metric collection.
Compared to similar skills
monitoring-apis side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| monitoring-apis (this skill) | 1 | 27d | Review | Advanced |
| analyzing-logs | 14 | 27d | Review | Beginner |
| obsidian-observability | 5 | 27d | Review | Intermediate |
| deepgram-performance-tuning | 3 | 27d | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by jeremylongshore
View all by jeremylongshore →You might also like
analyzing-logs
jeremylongshore
Analyze application logs to detect performance issues, identify error patterns, and improve stability by extracting key insights.
obsidian-observability
jeremylongshore
Set up comprehensive logging and monitoring for Obsidian plugins. Use when implementing debug logging, tracking plugin performance, or setting up error reporting for your Obsidian plugin. Trigger with phrases like "obsidian logging", "obsidian monitoring", "obsidian debug", "track obsidian plugin".
deepgram-performance-tuning
jeremylongshore
Optimize Deepgram API performance for faster transcription and lower latency. Use when improving transcription speed, reducing latency, or optimizing audio processing pipelines. Trigger with phrases like "deepgram performance", "speed up deepgram", "optimize transcription", "deepgram latency", "deepgram faster".
graphql
davila7
GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful also makes it dangerous. Without proper controls, clients can craft queries that bring down your server. This skill covers schema design, resolvers, DataLoader for N+1 prevention, federation for microservices, and client integration with Apollo/urql. Key insight: GraphQL is a contract. The schema is the API documentation. Design it carefully.
instruments-profiling
steipete
Use when profiling native macOS or iOS apps with Instruments/xctrace. Covers correct binary selection, CLI arguments, exports, and common gotchas.
worker-benchmarks
ruvnet
Run comprehensive worker system benchmarks and performance analysis