Skip to content

Commit

Permalink
chore: Update to the latest version of OpenTelemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
notheotherben committed Dec 6, 2023
1 parent bb6252b commit cd1f455
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 60 deletions.
107 changes: 57 additions & 50 deletions Cargo.lock

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

11 changes: 6 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ itertools = "0.12"
keyring = { version = "2.1", optional = true }
lazy_static = "1.4"
nix = { version = "0.27.1", features = ["process", "signal"] }
opentelemetry = { version = "0.20", features = ["rt-tokio"] }
opentelemetry-otlp = { version = "0.13", features = ["tls-roots"] }
opentelemetry = { version = "0.21" }
opentelemetry_sdk = { version = "0.21", features = ["rt-tokio"] }
opentelemetry-otlp = { version = "0.14", features = ["tls-roots"] }
once_cell = "1.18"
rpassword = { version = "7.3", optional = true }
reqwest = { version = "0.11.22", default-features = false, features = ["rustls-tls", "json", "stream"] }
Expand All @@ -35,11 +36,11 @@ serde_yaml = "0.9"
shell-words = "1.1"
tokio = { version = "1.34", features = ["rt", "time", "fs", "process", "macros", "signal"] }
tonic = { version = "0.9.2", features = ["tls-roots"] }
tracing = { version = "0.1.37", features = ["log"] }
tracing = { version = "0.1.40", features = ["log"] }
tracing-attributes = { git="https://github.com/SierraSoftworks/tracing.git" }
tracing-futures = { version = "0.2.5", features = ["futures-03"] }
tracing-opentelemetry = "0.21"
tracing-subscriber = { version = "0.3.17", features = ["tracing-log"] }
tracing-opentelemetry = "0.22"
tracing-subscriber = { version = "0.3.18", features = ["tracing-log"] }
trust-dns-resolver = { version = "0.23", features = ["tokio-runtime"] }

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ async fn run(matches: clap::ArgMatches) -> Result<i32, errors::Error> {
fn load_trace_context(span: &tracing::Span, context: &str) {
let carrier: std::collections::HashMap<String, String> =
serde_json::from_str(context).unwrap_or_default();
let propagator = opentelemetry::sdk::propagation::TraceContextPropagator::new();
let propagator = opentelemetry_sdk::propagation::TraceContextPropagator::new();
let parent_context = propagator.extract(&carrier);
span.set_parent(parent_context);
}
Expand Down
6 changes: 3 additions & 3 deletions src/telemetry/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ impl Session {
.with_endpoint("https://api.honeycomb.io:443")
.with_metadata(tracing_metadata),
)
.with_trace_config(opentelemetry::sdk::trace::config().with_resource(
opentelemetry::sdk::Resource::new(vec![
.with_trace_config(opentelemetry_sdk::trace::config().with_resource(
opentelemetry_sdk::Resource::new(vec![
opentelemetry::KeyValue::new("service.name", "git-tool"),
opentelemetry::KeyValue::new("service.version", version!("v")),
opentelemetry::KeyValue::new("host.os", std::env::consts::OS),
opentelemetry::KeyValue::new("host.architecture", std::env::consts::ARCH),
]),
))
.install_batch(opentelemetry::runtime::Tokio)
.install_batch(opentelemetry_sdk::runtime::Tokio)
.unwrap();

tracing_subscriber::registry()
Expand Down
2 changes: 1 addition & 1 deletion src/update/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub trait Launcher {
fn launch(&self, app_path: &Path, state: &UpdateState) -> Result<(), errors::Error> {
let trace_context = {
let mut context = std::collections::HashMap::new();
let propagator = opentelemetry::sdk::propagation::TraceContextPropagator::new();
let propagator = opentelemetry_sdk::propagation::TraceContextPropagator::new();
propagator.inject_context(&tracing::Span::current().context(), &mut context);

serde_json::to_string(&context)
Expand Down

0 comments on commit cd1f455

Please sign in to comment.