Skip to content

Commit

Permalink
Merge pull request #1344 from maticnetwork/mardizzone/promeserver_to
Browse files Browse the repository at this point in the history
internal/cli: add prometheus sever timeouts
  • Loading branch information
cffls authored Oct 7, 2024
2 parents c8c8311 + 63dd8d6 commit 2a7c58a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions internal/cli/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 2a7c58a

Please sign in to comment.