mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-08 23:18:15 -05:00
tracing: Add otel tracer transport to all http clients (#14972)
* Fixed otelhttp client setups. Note: This may not be the best solution as the http client is defined in many places. There should be a canoncial http client with the proper setup. * Changelog fragment * go mod tidy and gazelle
This commit is contained in:
@@ -19,6 +19,7 @@ go_library(
|
||||
"@com_github_prometheus_client_golang//prometheus:go_default_library",
|
||||
"@com_github_prometheus_client_golang//prometheus/promauto:go_default_library",
|
||||
"@com_github_sirupsen_logrus//:go_default_library",
|
||||
"@io_opentelemetry_go_contrib_instrumentation_net_http_otelhttp//:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ import (
|
||||
"github.com/prysmaticlabs/prysm/v5/monitoring/tracing"
|
||||
"github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace"
|
||||
"github.com/sirupsen/logrus"
|
||||
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -56,7 +57,7 @@ func NewApiClient(baseEndpoint string) (*ApiClient, error) {
|
||||
}
|
||||
return &ApiClient{
|
||||
BaseURL: u,
|
||||
RestClient: &http.Client{},
|
||||
RestClient: &http.Client{Transport: otelhttp.NewTransport(http.DefaultTransport)},
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user