Skip to content

Commit

Permalink
Fix AWS instrumentation
Browse files Browse the repository at this point in the history
  • Loading branch information
lbeschastny committed Oct 4, 2024
1 parent 0e5b79c commit 11222cf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use tracing_subscriber::fmt::format::FmtSpan;
use tracing_subscriber::layer::SubscriberExt;

use opentelemetry::trace::TracerProvider as _;
pub use opentelemetry::{Array, Context, Key, KeyValue, StringValue, Value};
pub use opentelemetry::{global, Array, Context, Key, KeyValue, StringValue, Value};
pub use opentelemetry_sdk::trace::TracerProvider;
pub use opentelemetry_semantic_conventions::attribute as semconv;
pub use tracing_opentelemetry::{OpenTelemetryLayer, OpenTelemetrySpanExt};
Expand Down Expand Up @@ -139,7 +139,8 @@ pub fn init_tracing_with_fallbacks(
let tracer_provider =
otlp::init_tracer(otel_rsrc, otlp::identity).expect("setup of Tracer");

opentelemetry::global::set_text_map_propagator(
global::set_tracer_provider(tracer_provider.clone());
global::set_text_map_propagator(
propagation::TextMapSplitPropagator::from_env().expect("setup of Propagation"),
);

Expand All @@ -166,7 +167,7 @@ macro_rules! init_tracing {

#[inline]
pub fn shutdown_signal() {
std::thread::spawn(opentelemetry::global::shutdown_tracer_provider)
std::thread::spawn(global::shutdown_tracer_provider)
.join()
.unwrap();
}

0 comments on commit 11222cf

Please sign in to comment.