Skip to content

Deprecate and Remove Redundant Monitoring REST Endpoints #87

Closed

Description

@mrveiss

Parent Issue

Part of #80 - Epic: Consolidate All Monitoring Systems into Prometheus + Grafana

Current State

Multiple overlapping REST endpoints:

  • GET /api/metrics/dashboard - Dashboard data
  • GET /api/metrics/performance/summary - Performance summary
  • GET /api/metrics/system/current - Current system metrics
  • GET /api/monitoring/services/health - Service health
  • GET /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 warnings
  • backend/api/monitoring.py - Mark WebSocket deprecated
  • backend/api/service_monitor.py - Redirect to Prometheus
  • backend/api/system.py - Deprecate system metrics
  • Frontend components to embed Grafana panels
  • API documentation

Labels: deprecation, monitoring, cleanup

Activity

  1. mrveiss commented on Dec 5, 2025

    @mrveiss
    OwnerAuthor

    ✅ Complete as part of Epic #80. All monitoring consolidated into Prometheus + Grafana. See Epic #80 for full details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions