feat(monitoring): add Prometheus and Grafana to observability stack - #134
feat(monitoring): add Prometheus and Grafana to observability stack#134tomkabel wants to merge 6 commits into
Conversation
- Adds user_id and optional email to access token payload - Maintains sub claim for backward compatibility - Binds request_id to structlog contextvars for correlation
- Replace reset_stuck_jobs with requeue_stuck_jobs in main loop - Zombie sweeper now writes outbox entry atomically with status update - Avoids dual-write problem when Redis is unavailable - Decouples outbox sync interval from cleanup (default 30s)
- Support TEST_DATABASE_URL override for real PostgreSQL tests - Add test-db and test-redis services to docker-compose.test.yml - Add postgres hatch script for integration testing - Keep per-worker SQLite as fast default
- Add prometheus service with persistent volume and health checks - Add grafana service with datasource and dashboard provisioning - Configure loopback-only ports for security (127.0.0.1) - Uses infra/grafana and infra/prometheus config files
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 34 minutes and 20 seconds.Comment |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Summary
Adds Prometheus as the metrics collection server and Grafana as the visualization layer to the existing monitoring compose, complementing the existing NetData agents.
Changes
Prometheus (
docker-compose.monitoring.yml)prometheus(v2.50.0)prometheus-datainfra/prometheus/prometheus.yml(mounted read-only)127.0.0.1:9090(loopback-only)/-/healthyendpointGrafana (
docker-compose.monitoring.yml)grafana(v10.3.1)grafana-datainfra/grafana/datasource.yml(auto-configured Prometheus)infra/grafana/dashboard-provider.yml127.0.0.1:3000(loopback-only)admin/admin(change via env vars)/api/healthendpointInfrastructure Config
infra/prometheus/prometheus.ymlinfra/grafana/datasource.ymlinfra/grafana/dashboard-provider.ymlUsage
Motivation
NetData provides real-time system metrics but lacks long-term storage and alerting. Prometheus + Grafana provides:
Testing
docker-compose -f docker-compose.monitoring.yml configvalidates successfullyLabels
monitoring