about summary refs log tree commit diff
path: root/tvix/tracing/src/lib.rs
diff options
context:
space:
mode:
authorYureka <tvl@yuka.dev>2024-07-20T18·15+0200
committerclbot <clbot@tvl.fyi>2024-07-21T11·01+0000
commitca8e2b9fbf4e58416655f237db02a331d0bc1f3d (patch)
tree0c14bd4a21e5367600cc9d0bcda563a33a879538 /tvix/tracing/src/lib.rs
parent1515a970bedbb6d7b5e8f966dddd0d8fff9bb03c (diff)
chore(tvix): upgrade to tonic 0.12 / hyper 1.0 r/8385
Change-Id: Idd8ce48869ddd869d51a10959b920f1290a8a9b3
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11991
Autosubmit: yuka <yuka@yuka.dev>
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/tracing/src/lib.rs')
-rw-r--r--tvix/tracing/src/lib.rs13
1 files changed, 7 insertions, 6 deletions
diff --git a/tvix/tracing/src/lib.rs b/tvix/tracing/src/lib.rs
index 35fdcda5a88a..fa9723d8cecc 100644
--- a/tvix/tracing/src/lib.rs
+++ b/tvix/tracing/src/lib.rs
@@ -6,7 +6,10 @@ use tracing_indicatif::{filter::IndicatifFilter, writer, IndicatifLayer, Indicat
 use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter, Layer};
 
 #[cfg(feature = "otlp")]
-use opentelemetry::{trace::Tracer, KeyValue};
+use opentelemetry::{
+    trace::{Tracer, TracerProvider},
+    KeyValue,
+};
 #[cfg(feature = "otlp")]
 use opentelemetry_sdk::{
     propagation::TraceContextPropagator,
@@ -264,7 +267,7 @@ fn gen_otlp_tracer(
     impl Tracer + tracing_opentelemetry::PreSampledTracer,
     mpsc::Sender<Option<oneshot::Sender<()>>>,
 ) {
-    let tracer = opentelemetry_otlp::new_pipeline()
+    let tracer_provider = opentelemetry_otlp::new_pipeline()
         .tracing()
         .with_exporter(opentelemetry_otlp::new_exporter().tonic())
         .with_batch_config(
@@ -281,7 +284,7 @@ fn gen_otlp_tracer(
                 .with_scheduled_delay(std::time::Duration::from_secs(10))
                 .build(),
         )
-        .with_trace_config(opentelemetry_sdk::trace::config().with_resource({
+        .with_trace_config(opentelemetry_sdk::trace::Config::default().with_resource({
             // use SdkProvidedResourceDetector.detect to detect resources,
             // but replace the default service name with our default.
             // https://github.com/open-telemetry/opentelemetry-rust/issues/1298
@@ -302,9 +305,7 @@ fn gen_otlp_tracer(
 
     // Trace provider is need for later use like flushing the provider.
     // Needs to be kept around for each message to rx we need to handle.
-    let tracer_provider = tracer
-        .provider()
-        .expect("Failed to get the tracer provider");
+    let tracer = tracer_provider.tracer("tvix");
 
     // Set up a channel for flushing trace providers later
     let (tx, mut rx) = mpsc::channel::<Option<oneshot::Sender<()>>>(16);