Skip to content

Commit

Permalink
internal/cli: add: prometheus sever timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
marcello33 committed Oct 7, 2024
1 parent c8c8311 commit 8185d48
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 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,
ReadTimeout: timeouts.ReadTimeout,
ReadHeaderTimeout: timeouts.ReadHeaderTimeout,
WriteTimeout: timeouts.WriteTimeout,
IdleTimeout: timeouts.IdleTimeout,
}

go func() {
Expand Down

0 comments on commit 8185d48

Please sign in to comment.