good morning!!!!

Skip to content
Snippets Groups Projects
Commit cd6a1633 authored by Shivam Sharma's avatar Shivam Sharma
Browse files

minor cleanup

parent a5bcab1c
No related branches found
No related tags found
No related merge requests found
......@@ -21,14 +21,11 @@ import (
"github.com/ethereum/go-ethereum/metrics/influxdb"
"github.com/ethereum/go-ethereum/metrics/prometheus"
"github.com/ethereum/go-ethereum/node"
"github.com/fjl/memsize/memsizeui"
"github.com/mattn/go-colorable"
"github.com/mattn/go-isatty"
"google.golang.org/grpc"
)
var Memsize memsizeui.Handler
type Server struct {
proto.UnimplementedBorServer
node *node.Node
......@@ -154,18 +151,10 @@ func (s *Server) setupMetrics(config *TelemetryConfig) error {
// Start system runtime metrics collection
go metrics.CollectProcessMetrics(3 * time.Second)
// Hook go-metrics into expvar on any /debug/metrics request, load all vars
// from the registry into expvar, and execute regular expvar handler.
if config.PrometheusAddr != "" {
prometheusMux := http.NewServeMux()
// this would cause a panic:
// panic: http: multiple registrations for /debug/vars
// http.HandleFunc("/debug/vars", e.expHandler)
// haven't found an elegant way, so just use a different endpoint
prometheusMux.HandleFunc("/metrics", func(w http.ResponseWriter, r *http.Request) {
prometheus.Handler(metrics.DefaultRegistry)
})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment