Comprehensive monitoring, logging, and alerting for Linear integrations using Prometheus metrics, structured logging, and health checks.
| Metric | Type | Purpose |
|---|---|---|
linear_api_requests_total |
Counter | Track request volume by operation/status |
linear_api_request_duration_seconds |
Histogram | Measure API latency |
linear_rate_limit_remaining |
Gauge | Monitor rate limit headroom |
linear_webhooks_received_total |
Counter | Track webhook volume |
linear_cache_hits_total |
Counter | Measure cache effectiveness |
Wrap the Linear SDK's fetch layer to capture metrics on every API call including operation name, duration, status, and rate limit headers.
Use pino/winston with JSON output, component tags, and correlation IDs for API calls, webhooks, and errors.
Verify API connectivity, cache status, and rate limit headroom. Return healthy, degraded, or unhealthy status.
Panels for request rate, latency p95, rate limit remaining, and webhook distribution.
See detailed implementation for full Prometheus metrics, instrumented client, logger, health check, alert rules, and Grafana dashboard JSON.
| Error | Cause | Solution |
|---|---|---|
| Metrics not collecting | Missing instrumentation | Wrap client with instrumented fetch |
| Alerts not firing | Wrong threshold | Adjust alert thresholds to match traffic |
| Missing labels | Logger misconfigured | Check logger base config and child loggers |
set -euo pipefail
curl http://localhost:3000/health/linear | jq # 3000: 3 seconds in ms
# { "status": "healthy", "checks": { "linear_api": { "status": "healthy", "latency_ms": 150 } } }
Create incident runbooks with linear-incident-runbook.