mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-01 01:23:46 +00:00
internal/cli: add: prometheus sever timeouts
This commit is contained in:
parent
c8c83116be
commit
8185d48f71
1 changed files with 7 additions and 0 deletions
|
|
@ -39,6 +39,7 @@ import (
|
|||
"github.com/ethereum/go-ethereum/metrics/influxdb"
|
||||
"github.com/ethereum/go-ethereum/metrics/prometheus"
|
||||
"github.com/ethereum/go-ethereum/node"
|
||||
"github.com/ethereum/go-ethereum/rpc"
|
||||
|
||||
// Force-load the tracer engines to trigger registration
|
||||
_ "github.com/ethereum/go-ethereum/eth/tracers/js"
|
||||
|
|
@ -360,9 +361,15 @@ func (s *Server) setupMetrics(config *TelemetryConfig, serviceName string) error
|
|||
|
||||
prometheusMux.Handle("/debug/metrics/prometheus", prometheus.Handler(metrics.DefaultRegistry))
|
||||
|
||||
timeouts := rpc.DefaultHTTPTimeouts
|
||||
|
||||
promServer := &http.Server{
|
||||
Addr: config.PrometheusAddr,
|
||||
Handler: prometheusMux,
|
||||
ReadTimeout: timeouts.ReadTimeout,
|
||||
ReadHeaderTimeout: timeouts.ReadHeaderTimeout,
|
||||
WriteTimeout: timeouts.WriteTimeout,
|
||||
IdleTimeout: timeouts.IdleTimeout,
|
||||
}
|
||||
|
||||
go func() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue