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 #3526

Merged
merged 2 commits into from
Nov 9, 2023
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
91 changes: 52 additions & 39 deletions Cargo.lock

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

9 changes: 6 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ otel = [
"dep:tracing-opentelemetry",
"dep:tracing-subscriber",
"dep:opentelemetry",
"dep:opentelemetry_sdk",
"dep:tokio",
]

Expand Down Expand Up @@ -63,6 +64,7 @@ opener = "0.6.0"
# allows controlling the vendoring status without exposing the presence of the download crate.
openssl = { version = "0.10", optional = true }
opentelemetry = { workspace = true, optional = true }
opentelemetry_sdk = { workspace = true, optional = true }
opentelemetry-otlp = { workspace = true, optional = true }
pulldown-cmark = { version = "0.9", default-features = false }
rand = "0.8"
Expand Down Expand Up @@ -157,16 +159,17 @@ derivative = "2.2.0"
enum_dispatch = "0.3.11"
fs_at = "0.1.6"
once_cell = "1.18.0"
opentelemetry = { version = "0.20.0", features = ["rt-tokio"] }
opentelemetry-otlp = { version = "0.13.0" }
opentelemetry = "0.21.0"
opentelemetry_sdk = { version = "0.21.0", features = ["rt-tokio"] }
opentelemetry-otlp = "0.14.0"
proptest = "1.1.0"
rustup-macros = { path = "rustup-macros" }
tempfile = "3.8"
termcolor = "1.2"
thiserror = "1.0"
tokio = { version = "1.26.0", default-features = false, features = ["rt-multi-thread"] }
tracing = "0.1"
tracing-opentelemetry = { version = "0.21.0" }
tracing-opentelemetry = "0.22.0"
tracing-subscriber = "0.3.16"
url = "2.4"
walkdir = "2"
Expand Down
10 changes: 5 additions & 5 deletions src/bin/rustup-init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ fn maybe_trace_rustup() -> Result<utils::ExitCode> {
{
use std::time::Duration;

use opentelemetry::sdk::{
use opentelemetry::{global, KeyValue};
use opentelemetry_otlp::WithExportConfig;
use opentelemetry_sdk::{
propagation::TraceContextPropagator,
trace::{self, Sampler},
Resource,
};
use opentelemetry::KeyValue;
use opentelemetry::{global, sdk::propagation::TraceContextPropagator};
use opentelemetry_otlp::WithExportConfig;
use tracing_subscriber::{layer::SubscriberExt, EnvFilter, Registry};

// Background submission requires a runtime, and since we're probably
Expand All @@ -84,7 +84,7 @@ fn maybe_trace_rustup() -> Result<utils::ExitCode> {
"rustup",
)])),
)
.install_batch(opentelemetry::runtime::Tokio)?;
.install_batch(opentelemetry_sdk::runtime::Tokio)?;
let env_filter = EnvFilter::try_from_default_env().unwrap_or(EnvFilter::new("INFO"));
let telemetry = tracing_opentelemetry::layer().with_tracer(tracer);
let subscriber = Registry::default().with(env_filter).with(telemetry);
Expand Down
19 changes: 8 additions & 11 deletions src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,19 +233,16 @@ static TRACE_RUNTIME: Lazy<tokio::runtime::Runtime> =
Lazy::new(|| tokio::runtime::Runtime::new().unwrap());
/// A tracer for the tests.
#[cfg(feature = "otel")]
static TRACER: Lazy<opentelemetry::sdk::trace::Tracer> = Lazy::new(|| {
static TRACER: Lazy<opentelemetry_sdk::trace::Tracer> = Lazy::new(|| {
use std::time::Duration;

use opentelemetry::KeyValue;
use opentelemetry::{
global,
sdk::{
propagation::TraceContextPropagator,
trace::{self, Sampler},
Resource,
},
};
use opentelemetry::{global, KeyValue};
use opentelemetry_otlp::WithExportConfig;
use opentelemetry_sdk::{
propagation::TraceContextPropagator,
trace::{self, Sampler},
Resource,
};
use tokio::runtime::Handle;
use tracing_subscriber::{layer::SubscriberExt, EnvFilter, Registry};

Expand All @@ -268,7 +265,7 @@ static TRACER: Lazy<opentelemetry::sdk::trace::Tracer> = Lazy::new(|| {
.with_sampler(Sampler::AlwaysOn)
.with_resource(Resource::new(vec![KeyValue::new("service.name", "rustup")])),
)
.install_batch(opentelemetry::runtime::Tokio)
.install_batch(opentelemetry_sdk::runtime::Tokio)
.unwrap();

global::set_text_map_propagator(TraceContextPropagator::new());
Expand Down