mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 23:26:44 +00:00
Merge pull request #1344 from maticnetwork/mardizzone/promeserver_to
internal/cli: add prometheus sever timeouts
This commit is contained in:
commit
2a7c58a616
1 changed files with 9 additions and 2 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,
|
||||
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