mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
*: Change gRPC proxy to expose etcd server endpoint /metrics
This PR resolves an issue where the `/metrics` endpoints exposed by the proxy were not returning metrics of the etcd members servers but of the proxy itself. Signed-off-by: Sam Batschelet <sbatsche@redhat.com>
This commit is contained in:
committed by
Sam Batschelet
parent
332e995ccd
commit
43386ac29b
@@ -29,19 +29,19 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
pathMetrics = "/metrics"
|
||||
PathMetrics = "/metrics"
|
||||
PathHealth = "/health"
|
||||
)
|
||||
|
||||
// HandleMetricsHealth registers metrics and health handlers.
|
||||
func HandleMetricsHealth(mux *http.ServeMux, srv etcdserver.ServerV2) {
|
||||
mux.Handle(pathMetrics, promhttp.Handler())
|
||||
mux.Handle(PathMetrics, promhttp.Handler())
|
||||
mux.Handle(PathHealth, NewHealthHandler(func() Health { return checkHealth(srv) }))
|
||||
}
|
||||
|
||||
// HandlePrometheus registers prometheus handler on '/metrics'.
|
||||
func HandlePrometheus(mux *http.ServeMux) {
|
||||
mux.Handle(pathMetrics, promhttp.Handler())
|
||||
mux.Handle(PathMetrics, promhttp.Handler())
|
||||
}
|
||||
|
||||
// NewHealthHandler handles '/health' requests.
|
||||
|
||||
Reference in New Issue
Block a user