Repository navigation
Deprecate and Remove Redundant Monitoring REST Endpoints #87
Copy link
Copy link
Closed
Labels
Description
Parent Issue
Part of #80 - Epic: Consolidate All Monitoring Systems into Prometheus + Grafana
Current State
Multiple overlapping REST endpoints:
GET /api/metrics/dashboard- Dashboard dataGET /api/metrics/performance/summary- Performance summaryGET /api/metrics/system/current- Current system metricsGET /api/monitoring/services/health- Service healthGET /api/system/metrics- System metrics- Plus WebSocket endpoints for real-time streaming
These endpoints duplicate data now available via Prometheus.
Goal
Gradually deprecate and remove redundant endpoints to eliminate duplicate metric collection.
Implementation
Phase 1: Mark as Deprecated (2 weeks)
Add deprecation warnings to responses:
@router.get("/dashboard", deprecated=True)
async def get_dashboard():
return {
"deprecated": True,
"message": "Use Prometheus + Grafana for metrics. See /docs/monitoring/",
"sunset_date": "2025-01-15",
"data": ...
}Phase 2: Add Redirect Headers
response.headers["Deprecation"] = "true"
response.headers["Sunset"] = "Wed, 15 Jan 2025 00:00:00 GMT"
response.headers["Link"] = '</api/prometheus/metrics>; rel="successor-version"'Phase 3: Remove Endpoints
After Grafana dashboards are complete and team is using them:
- Remove deprecated endpoints
- Update frontend to use Grafana embedded panels
- Delete in-memory metric stores
Endpoints to Deprecate
| Endpoint | Replacement |
|---|---|
/api/metrics/dashboard |
Grafana dashboard |
/api/metrics/performance/summary |
Prometheus autobot_* metrics |
/api/metrics/system/current |
Prometheus autobot_cpu_*, autobot_memory_* |
/api/monitoring/services/health |
Prometheus autobot_service_health |
/api/system/metrics |
Prometheus scrape endpoint |
WS /ws/monitoring |
Grafana live dashboard |
Keep These Endpoints
/api/health- Quick liveness check (no metrics)/metrics- Prometheus scrape endpoint (canonical)/api/prometheus/metrics- Prometheus text format
Acceptance Criteria
- All redundant endpoints marked deprecated
- Deprecation warnings in API responses
- Sunset dates communicated to users
- Frontend updated to use Grafana
- Endpoints removed after sunset period
- No data loss during transition
- Documentation updated
Files to Modify
backend/api/metrics.py- Add deprecation warningsbackend/api/monitoring.py- Mark WebSocket deprecatedbackend/api/service_monitor.py- Redirect to Prometheusbackend/api/system.py- Deprecate system metrics- Frontend components to embed Grafana panels
- API documentation
Labels: deprecation, monitoring, cleanup
Reactions are currently unavailable
Activity
mrveiss commentedon Dec 5, 2025
✅ Complete as part of Epic #80. All monitoring consolidated into Prometheus + Grafana. See Epic #80 for full details.