Skip to content

Commit

Permalink
otel interation patch
Browse files Browse the repository at this point in the history
  • Loading branch information
zaychenko-sergei committed Sep 20, 2024
1 parent 38d28fd commit c548cf4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/utils/observability/src/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ fn init_otel_tracer(cfg: &Config) -> opentelemetry_sdk::trace::Tracer {
.with_endpoint(cfg.otlp_endpoint.as_ref().unwrap())
.with_timeout(Duration::from_secs(5));

use opentelemetry::trace::TracerProvider;
opentelemetry_otlp::new_pipeline()
.tracing()
.with_exporter(otel_exporter)
Expand All @@ -157,7 +158,9 @@ fn init_otel_tracer(cfg: &Config) -> opentelemetry_sdk::trace::Tracer {
.with_sampler(opentelemetry_sdk::trace::Sampler::AlwaysOn),
)
.install_batch(opentelemetry_sdk::runtime::Tokio)
.expect("Creating tracer")
.expect("Creating tracer provider")
.tracer_builder(cfg.service_name.clone())
.build()
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit c548cf4

Please sign in to comment.