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
This commit is contained in:
parent
405d3dc746
commit
d1f056471d
1 changed files with 2 additions and 9 deletions
|
|
@ -353,17 +353,10 @@ func (m *Manager) SetupHTTPServer(addr string, healthServer *health.Server) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m.httpServer = &http.Server{
|
|
||||||
Addr: addr,
|
|
||||||
Handler: m.mux,
|
|
||||||
ReadTimeout: 30 * time.Second,
|
ReadTimeout: 30 * time.Second,
|
||||||
WriteTimeout: 30 * time.Second,
|
WriteTimeout: 30 * time.Second,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wrap the entire server handler with metrics tracking too
|
|
||||||
m.httpServer.Handler = &metricMiddleware{handler: m.mux}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Manager) StartAll(ctx context.Context) error {
|
func (m *Manager) StartAll(ctx context.Context) error {
|
||||||
m.mu.Lock()
|
m.mu.Lock()
|
||||||
defer m.mu.Unlock()
|
defer m.mu.Unlock()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue