Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update opentelemetry Rust crates #5040

Merged
merged 2 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
149 changes: 90 additions & 59 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,9 @@ mimalloc = { version = "=0.1.43", default-features = false }
mime = { version = "=0.3.17", default-features = false }
num-traits = { version = "=0.2.19", default-features = false }
once_cell = { version = "=1.20.2", default-features = false }
opentelemetry = { version = "=0.23.0", default-features = false }
opentelemetry-otlp = { version = "=0.16.0", default-features = false }
opentelemetry_sdk = { version = "=0.23.0", default-features = false }
opentelemetry = { version = "=0.26.0", default-features = false }
opentelemetry-otlp = { version = "=0.26.0", default-features = false }
opentelemetry_sdk = { version = "=0.26.0", default-features = false }
orx-concurrent-vec = { version = "=3.0.2", default-features = false }
owo-colors = { version = "=4.1.0", default-features = false }
paste = { version = "=1.0.15", default-features = false }
Expand Down Expand Up @@ -212,7 +212,7 @@ tower-test = { version = "=0.4.0", default-features = false }
tracing = { version = "=0.1.40", default-features = false }
tracing-error = { version = "=0.2.0", default-features = false }
tracing-flame = { version = "=0.2.0", default-features = false }
tracing-opentelemetry = { version = "=0.24.0", default-features = false }
tracing-opentelemetry = { version = "=0.27.0", default-features = false }
trybuild = { version = "=1.0.99", default-features = false }
tsify = { version = "=0.4.5", default-features = false }
unicode-ident = { version = "=1.0.13", default-features = false }
Expand Down
9 changes: 5 additions & 4 deletions libs/@local/tracing/src/opentelemetry.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use core::time::Duration;

use opentelemetry::{KeyValue, global};
use opentelemetry::{KeyValue, global, trace::TracerProvider};
use opentelemetry_otlp::WithExportConfig;
use opentelemetry_sdk::{
Resource,
propagation::TraceContextPropagator,
trace::{RandomIdGenerator, Sampler},
trace::{Config, RandomIdGenerator, Sampler},
};
use tokio::runtime::Handle;
use tracing::Subscriber;
Expand Down Expand Up @@ -68,7 +68,7 @@ where
// - OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT
// - OTEL_SPAN_EVENT_COUNT_LIMIT
// - OTEL_SPAN_LINK_COUNT_LIMIT
let trace_config = opentelemetry_sdk::trace::config()
let trace_config = Config::default()
.with_sampler(Sampler::ParentBased(Box::new(Sampler::TraceIdRatioBased(
0.1,
))))
Expand All @@ -81,7 +81,8 @@ where
.with_exporter(pipeline)
.with_trace_config(trace_config)
.install_batch(opentelemetry_sdk::runtime::Tokio)
.expect("failed to create OTLP tracer, check configuration values");
.expect("failed to create OTLP tracer provider, check configuration values")
.tracer("graph");

Some(tracing_opentelemetry::layer().with_tracer(tracer))
}
Loading