Skip to content

Commit

Permalink
move sdk stuff to opentelemetry_sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
cpiemontese committed Nov 28, 2023
1 parent 502d883 commit ce906a1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ traces = ["tracing-opentelemetry", "opentelemetry", "opentelemetry-otlp"]
dev = ["traces"]
live = ["json-logger", "datadog", "traces"]

rt-tokio-current-thread = ["opentelemetry/rt-tokio-current-thread"]
rt-tokio-current-thread = ["opentelemetry_sdk/rt-tokio-current-thread"]

[[example]]
name = "custom-json-subscriber"
Expand All @@ -37,8 +37,9 @@ required-features = ["json-logger"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
opentelemetry = {version = "0.21", features = ["rt-tokio"], optional = true}
opentelemetry = {version = "0.21", optional = true}
opentelemetry-otlp = {version = "0.14", features = ["http-proto", "reqwest-client"], default-features = false, optional = true}
opentelemetry_sdk = {version = "0.21", features = ["rt-tokio"], optional = true}
tracing = {version = "0.1", features = ["max_level_debug", "release_max_level_info"]}
tracing-log = {version = "0.2"}
tracing-opentelemetry = {version = "0.22", optional = true}
Expand Down
3 changes: 2 additions & 1 deletion src/subscriber.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ pub fn init_subscriber(subscriber: impl Subscriber + Sync + Send) -> Uninstall {

#[cfg(feature = "traces")]
{
use opentelemetry::{global, sdk::propagation::TraceContextPropagator};
use opentelemetry::global;
use opentelemetry_sdk::propagation::TraceContextPropagator;
global::set_text_map_propagator(TraceContextPropagator::new());
};
Uninstall
Expand Down
16 changes: 7 additions & 9 deletions src/telemetry.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
use opentelemetry::{
sdk::{
trace::{self, Tracer},
Resource,
},
KeyValue,
};
use opentelemetry::KeyValue;
use opentelemetry_otlp::WithExportConfig;
use opentelemetry_sdk::{
trace::{self, Tracer},
Resource,
};
use tracing::{span, Subscriber};
use tracing_opentelemetry::OtelData;
use tracing_subscriber::{layer::Context, Layer};
Expand All @@ -21,11 +19,11 @@ pub fn configure<T>(config: &SubscriberConfig<T>) -> Tracer {
let runtime = {
#[cfg(feature = "rt-tokio-current-thread")]
{
opentelemetry::runtime::TokioCurrentThread
opentelemetry_sdk::runtime::TokioCurrentThread
}
#[cfg(not(feature = "rt-tokio-current-thread"))]
{
opentelemetry::runtime::Tokio
opentelemetry_sdk::runtime::Tokio
}
};

Expand Down

0 comments on commit ce906a1

Please sign in to comment.