diff options
author | Sean E. Russell <ser@ser1.net> | 2020-05-12 18:42:45 -0500 |
---|---|---|
committer | Sean E. Russell <ser@ser1.net> | 2020-05-12 18:42:45 -0500 |
commit | 310a6d084d5ff56ebb26cd667f46f578b39c737a (patch) | |
tree | a1b98a9a3736f9c8aa9057623f62b109294dc4f3 /cmd | |
parent | b0e1e9a20ad2c198b65df420aef5821c7be7208c (diff) |
Replaces the Prometheus client with VictoriaMetrics/metrics
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/gotop/main.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cmd/gotop/main.go b/cmd/gotop/main.go index 25dd5b8..dc869ce 100644 --- a/cmd/gotop/main.go +++ b/cmd/gotop/main.go @@ -17,8 +17,8 @@ import ( //_ "net/http/pprof" + "github.com/VictoriaMetrics/metrics" ui "github.com/gizak/termui/v3" - "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/shibukawa/configdir" "github.com/xxxserxxx/opflag" @@ -447,7 +447,9 @@ func run() int { if conf.ExportPort != "" { go func() { - http.Handle("/metrics", promhttp.Handler()) + http.HandleFunc("/metrics", func(w http.ResponseWriter, req *http.Request) { + metrics.WritePrometheus(w, true) + }) http.ListenAndServe(conf.ExportPort, nil) }() } |