From d1f056471d5f6b0ae49b9dc2dea4ee6cd19f822c Mon Sep 17 00:00:00 2001 From: liugangjian Date: Wed, 4 Mar 2026 21:15:16 +0800 Subject: [PATCH] feat: Add Prometheus metrics support - Add /metrics endpoint for exporting metrics in Prometheus format - Add standard HTTP metrics (requests, latency, errors) - Add middleware to capture metrics from HTTP endpoints - Integrate with existing health server infrastructure --- pkg/channels/manager.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/pkg/channels/manager.go b/pkg/channels/manager.go index bb8163195..697c2d5db 100644 --- a/pkg/channels/manager.go +++ b/pkg/channels/manager.go @@ -353,15 +353,8 @@ func (m *Manager) SetupHTTPServer(addr string, healthServer *health.Server) { } } - m.httpServer = &http.Server{ - Addr: addr, - Handler: m.mux, - ReadTimeout: 30 * time.Second, - WriteTimeout: 30 * time.Second, - } - - // Wrap the entire server handler with metrics tracking too - m.httpServer.Handler = &metricMiddleware{handler: m.mux} + ReadTimeout: 30 * time.Second, + WriteTimeout: 30 * time.Second, } func (m *Manager) StartAll(ctx context.Context) error {