Skip to content

Commit 10e72df

Browse files
authored
Add tls-roots feature to opentelemetry_otlp to support exporting traces over https (#7987)
1 parent a93cafe commit 10e72df

File tree

3 files changed

+60
-10
lines changed

3 files changed

+60
-10
lines changed

Cargo.lock

Lines changed: 56 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ node_test_rig = { path = "testing/node_test_rig" }
198198
num_cpus = "1"
199199
once_cell = "1.17.1"
200200
opentelemetry = "0.30.0"
201-
opentelemetry-otlp = { version = "0.30.0", features = ["grpc-tonic"] }
201+
opentelemetry-otlp = { version = "0.30.0", features = ["grpc-tonic", "tls-roots"] }
202202
opentelemetry_sdk = "0.30.0"
203203
operation_pool = { path = "beacon_node/operation_pool" }
204204
parking_lot = "0.12"

lighthouse/src/main.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ use lighthouse_version::VERSION;
2020
use logging::{MetricsLayer, build_workspace_filter, crit};
2121
use malloc_utils::configure_memory_allocator;
2222
use opentelemetry::trace::TracerProvider;
23-
use opentelemetry_otlp::WithExportConfig;
23+
use opentelemetry_otlp::tonic_types::transport::ClientTlsConfig;
24+
use opentelemetry_otlp::{WithExportConfig, WithTonicConfig};
2425
use std::backtrace::Backtrace;
2526
use std::io::IsTerminal;
2627
use std::path::PathBuf;
@@ -712,6 +713,7 @@ fn run<E: EthSpec>(
712713
let telemetry_layer = environment.runtime().block_on(async {
713714
let exporter = opentelemetry_otlp::SpanExporter::builder()
714715
.with_tonic()
716+
.with_tls_config(ClientTlsConfig::new().with_native_roots())
715717
.with_endpoint(telemetry_collector_url)
716718
.build()
717719
.map_err(|e| format!("Failed to create OTLP exporter: {:?}", e))?;

0 commit comments

Comments
 (0)