mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-28 07:36:44 +00:00
minor cleanup
This commit is contained in:
parent
a5bcab1c65
commit
cd6a163391
1 changed files with 0 additions and 11 deletions
|
|
@ -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)
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue