metrics/prometheus: expose metrics in prometheus format too (#17077)
* metrics/prometheus: added prometheus http server and metrics collector * metrics/prometheus: minor cleanups * metrics/prometheus: named keys instead name in tag * metrics/prometheus: minor typo cleanups, sorted report
This commit is contained in:
committed by
Péter Szilágyi
parent
74acde4b08
commit
31bc2a2434
@ -9,6 +9,7 @@ import (
|
||||
"sync"
|
||||
|
||||
"github.com/ethereum/go-ethereum/metrics"
|
||||
"github.com/ethereum/go-ethereum/metrics/prometheus"
|
||||
)
|
||||
|
||||
type exp struct {
|
||||
@ -42,6 +43,7 @@ func Exp(r metrics.Registry) {
|
||||
// http.HandleFunc("/debug/vars", e.expHandler)
|
||||
// haven't found an elegant way, so just use a different endpoint
|
||||
http.Handle("/debug/metrics", h)
|
||||
http.Handle("/debug/metrics/prometheus", prometheus.Handler(r))
|
||||
}
|
||||
|
||||
// ExpHandler will return an expvar powered metrics handler.
|
||||
|
Reference in New Issue
Block a user