pub(crate) fn HandleMetricsRequest() -> StringExpand description
Handler for /metrics endpoint - returns Prometheus format metrics
Exports all collected metrics in Prometheus text format for scraping by monitoring systems like Prometheus, Grafana, or custom dashboards.
Metrics include:
- Request counters (total, successful, failed)
- Response times (histogram)
- Resource usage (memory, CPU)
- Connection counts
- Background task status
ยงTODO
- Add timeout for metrics export (should not block daemon)
- Implement metric label support (service, host, etc.)
- Add counter reset capability
- Implement metric filtering via query parameters
- Add histogram quantiles (p50, p95, p99)
- Support both Prometheus and OpenMetrics formats