Skip to content

Commit

Permalink
Merge branch 'main' into bug/1209-fix-upgrade-performance
Browse files Browse the repository at this point in the history
  • Loading branch information
lalitb committed Jan 3, 2024
2 parents 86767ad + f31c4dd commit 731901c
Show file tree
Hide file tree
Showing 30 changed files with 177 additions and 143 deletions.
33 changes: 33 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,36 @@ resolver = "2"
# See function names in profiling reports.
# 2/true is too much, 0 is not enough, 1 is just right for back traces
debug = 1

[workspace.dependencies]
async-std = "1.10"
async-trait = "0.1"
bytes = "1"
env_logger = "0.10"
futures-core = "0.3"
futures-executor = "0.3"
futures-util = "0.3"
grpcio = "0.12"
hyper = "0.14"
http = "0.2"
isahc = "1.4"
log = "0.4"
one_cell = "1.13"
ordered-float = "4.0"
pin-project = "0.2"
pin-project-lite = "0.2"
prost = "0.11"
rand = "0.8"
reqwest = "0.11"
serde = "1.0"
serde_json = "1.0"
surf = "2.0"
temp-env = "0.3.6"
thiserror = "1"
tonic = "0.9"
tokio = "1"
tokio-stream = "0.1.1"
tracing = "0.1"
tracing-core = "0.1"
tracing-subscriber = "0.3"
url = "2.2"
4 changes: 2 additions & 2 deletions examples/logs-basic/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ opentelemetry = { path = "../../opentelemetry", features = ["logs"] }
opentelemetry_sdk = { path = "../../opentelemetry-sdk", features = ["logs"] }
opentelemetry-stdout = { path = "../../opentelemetry-stdout", features = ["logs"]}
opentelemetry-appender-log = { path = "../../opentelemetry-appender-log", default-features = false}
log = {version = "0.4.17"}
serde_json = {version = "1.0"}
log = { workspace = true }
serde_json = { workspace = true }
4 changes: 2 additions & 2 deletions examples/metrics-advanced/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ publish = false
opentelemetry = { path = "../../opentelemetry", features = ["metrics"] }
opentelemetry_sdk = { path = "../../opentelemetry-sdk", features = ["metrics", "rt-tokio"] }
opentelemetry-stdout = { path = "../../opentelemetry-stdout", features = ["metrics"]}
tokio = { version = "1.0", features = ["full"] }
serde_json = {version = "1.0"}
tokio = { workspace = true, features = ["full"] }
serde_json = { workspace = true }
4 changes: 2 additions & 2 deletions examples/metrics-basic/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ publish = false
opentelemetry = { path = "../../opentelemetry", features = ["metrics", "otel_unstable"] }
opentelemetry_sdk = { path = "../../opentelemetry-sdk", features = ["metrics", "rt-tokio"] }
opentelemetry-stdout = { path = "../../opentelemetry-stdout", features = ["metrics"]}
tokio = { version = "1.0", features = ["full"] }
serde_json = {version = "1.0"}
tokio = { workspace = true, features = ["full"] }
serde_json = { workspace = true }

[features]
default = ["otel_unstable"]
Expand Down
6 changes: 3 additions & 3 deletions examples/tracing-grpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ path = "src/client.rs"
opentelemetry = { path = "../../opentelemetry" }
opentelemetry_sdk = { path = "../../opentelemetry-sdk", features = ["rt-tokio"]}
opentelemetry-stdout = { path = "../../opentelemetry-stdout", features = ["trace"] }
prost = "0.11"
tokio = { version = "1.28", features = ["full"] }
tonic = "0.9.2"
prost = { workspace = true }
tokio = { workspace = true, features = ["full"] }
tonic = { workspace = true }

[build-dependencies]
tonic-build = "0.9.2"
6 changes: 3 additions & 3 deletions examples/tracing-http-propagator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ path = "src/client.rs"
doc = false

[dependencies]
hyper = { version = "0.14", features = ["full"] }
tokio = { version = "1.0", features = ["full"] }
hyper = { workspace = true, features = ["full"] }
tokio = { workspace = true, features = ["full"] }
opentelemetry = { path = "../../opentelemetry" }
opentelemetry_sdk = { path = "../../opentelemetry-sdk" }
opentelemetry-http = { path = "../../opentelemetry-http" }
opentelemetry-stdout = { path = "../../opentelemetry-stdout", features = ["trace"] }
opentelemetry-semantic-conventions = { path = "../../opentelemetry-semantic-conventions" }
opentelemetry-semantic-conventions = { path = "../../opentelemetry-semantic-conventions" }
2 changes: 1 addition & 1 deletion examples/tracing-jaeger/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ publish = false
opentelemetry = { path = "../../opentelemetry" }
opentelemetry_sdk = { path = "../../opentelemetry-sdk", features = ["rt-tokio"] }
opentelemetry-otlp = { path = "../../opentelemetry-otlp", features = ["tonic"] }
tokio = { version = "1.0", features = ["full"] }
tokio = { workspace = true, features = ["full"] }
4 changes: 2 additions & 2 deletions opentelemetry-appender-log/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ edition = "2021"

[dependencies]
opentelemetry = { version = "0.21", path = "../opentelemetry", features = ["logs"]}
log = {version = "0.4.17", features = ["kv_unstable", "std"]}
log = { workspace = true, features = ["kv_unstable", "std"]}

[features]
logs_level_enabled = ["opentelemetry/logs_level_enabled"]
default = ["logs_level_enabled"]

[dev-dependencies]
opentelemetry_sdk = { path = "../opentelemetry-sdk", features = [ "testing", "logs_level_enabled" ] }
tokio = "1.32.0"
tokio = { workspace = true }
10 changes: 5 additions & 5 deletions opentelemetry-appender-tracing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ license = "Apache-2.0"
rust-version = "1.65"

[dependencies]
log = { version = "0.4", optional = true }
log = { workspace = true, optional = true }
opentelemetry = { version = "0.21", path = "../opentelemetry", features = ["logs"] }
opentelemetry_sdk = { version = "0.21", path = "../opentelemetry-sdk", features = ["logs"] }
tracing = {version = "0.1", default-features = false, features = ["std"]}
tracing-core = "0.1"
tracing = { workspace = true, default-features = false, features = ["std"]}
tracing-core = { workspace = true }
tracing-log = { version = "0.2", optional = true }
tracing-subscriber = { version = "0.3", default-features = false, features = ["registry", "std"] }
tracing-subscriber = { workspace = true, default-features = false, features = ["registry", "std"] }
once_cell = "1.13.0"

[dev-dependencies]
log = "0.4"
log = { workspace = true }
opentelemetry-stdout = { path = "../opentelemetry-stdout", features = ["logs"] }
opentelemetry_sdk = { path = "../opentelemetry-sdk", features = ["logs", "testing"] }
tracing-log = "0.2"
Expand Down
8 changes: 4 additions & 4 deletions opentelemetry-appender-tracing/src/layer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ mod tests {
.expect("Logs are expected to be exported.");
assert_eq!(exported_logs.len(), 1);
let log = exported_logs
.get(0)
.first()
.expect("Atleast one log is expected to be present.");

// Validate common fields
Expand Down Expand Up @@ -325,7 +325,7 @@ mod tests {
.expect("Logs are expected to be exported.");
assert_eq!(exported_logs.len(), 1);
let log = exported_logs
.get(0)
.first()
.expect("Atleast one log is expected to be present.");

// validate common fields.
Expand Down Expand Up @@ -409,7 +409,7 @@ mod tests {
.expect("Logs are expected to be exported.");
assert_eq!(exported_logs.len(), 1);
let log = exported_logs
.get(0)
.first()
.expect("Atleast one log is expected to be present.");

// Validate common fields
Expand Down Expand Up @@ -489,7 +489,7 @@ mod tests {
.expect("Logs are expected to be exported.");
assert_eq!(exported_logs.len(), 1);
let log = exported_logs
.get(0)
.first()
.expect("Atleast one log is expected to be present.");

// validate common fields.
Expand Down
16 changes: 8 additions & 8 deletions opentelemetry-http/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ edition = "2021"
rust-version = "1.65"

[dependencies]
async-trait = "0.1"
bytes = "1"
http = "0.2"
hyper = { version = "0.14", default-features = false, features = ["http2", "client", "tcp"], optional = true }
isahc = { version = "1.4", default-features = false, optional = true }
async-trait = { workspace = true }
bytes = { workspace = true }
http = { workspace = true }
hyper = { workspace = true, default-features = false, features = ["http2", "client", "tcp"], optional = true }
isahc = { workspace = true, default-features = false, optional = true }
opentelemetry = { version = "0.21", path = "../opentelemetry", features = ["trace"] }
reqwest = { version = "0.11", default-features = false, features = ["blocking"], optional = true }
surf = { version = "2.0", default-features = false, optional = true }
tokio = { version = "1.0", default-features = false, features = ["time"], optional = true }
reqwest = { workspace = true, default-features = false, features = ["blocking"], optional = true }
surf = { workspace = true, default-features = false, optional = true }
tokio = { workspace = true, default-features = false, features = ["time"], optional = true }
32 changes: 16 additions & 16 deletions opentelemetry-jaeger/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,40 +20,40 @@ all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
async-std = { version = "1.10.0", optional = true }
async-trait = "0.1"
async-std = { workspace = true, optional = true }
async-trait = { workspace = true }
base64 = { version = "0.21.0", optional = true }
headers = { version = "0.3.2", optional = true }
http = { version = "0.2", optional = true }
hyper = { version = "0.14", default-features = false, features = ["client"], optional = true }
http = { workspace = true, optional = true }
hyper = { workspace = true, default-features = false, features = ["client"], optional = true }
hyper-tls = { version = "0.5.0", default-features = false, optional = true }
isahc = { version = "1.4", default-features = false, optional = true }
isahc = { workspace = true, default-features = false, optional = true }
js-sys = { version = "0.3", optional = true }
opentelemetry = { version = "0.21", default-features = false, features = ["trace"], path = "../opentelemetry" }
opentelemetry_sdk = { version = "0.21", default-features = false, features = ["trace"], path = "../opentelemetry-sdk" }
opentelemetry-http = { version = "0.10", path = "../opentelemetry-http", optional = true }
opentelemetry-semantic-conventions = { version = "0.13", path = "../opentelemetry-semantic-conventions" }
pin-project-lite = { version = "0.2", optional = true }
reqwest = { version = "0.11", default-features = false, optional = true }
surf = { version = "2.0", optional = true }
pin-project-lite = { workspace = true, optional = true }
reqwest = { workspace = true, default-features = false, optional = true }
surf = { workspace = true, optional = true }
thrift = "0.17.0"
tokio = { version = "1.0", features = ["net", "sync"], optional = true }
tokio = { workspace = true, features = ["net", "sync"], optional = true }
wasm-bindgen = { version = "0.2", optional = true }
wasm-bindgen-futures = { version = "0.4.18", optional = true }

tonic = { version = "0.9.0", optional = true }
tonic = { workspace = true, optional = true }
prost = { version = "0.11.6", optional = true }
prost-types = { version = "0.11.6", optional = true }

# Futures
futures-executor = { version = "0.3", default-features = false, features = ["std"], optional = true }
futures-core = "0.3"
futures-util = { version = "0.3", default-features = false, features = ["std", "alloc"]}
futures-executor = { workspace = true, default-features = false, features = ["std"], optional = true }
futures-core = { workspace = true }
futures-util = { workspace = true, default-features = false, features = ["std", "alloc"]}

[dev-dependencies]
tokio = { version = "1.0", features = ["net", "sync"] }
bytes = "1"
futures-executor = "0.3"
tokio = { workspace = true, features = ["net", "sync"] }
bytes = { workspace = true }
futures-executor = { workspace = true }
opentelemetry_sdk = { features = ["trace", "testing", "rt-tokio"], path = "../opentelemetry-sdk" }

[dependencies.web-sys]
Expand Down
4 changes: 2 additions & 2 deletions opentelemetry-jaeger/examples/remote-sampler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ edition = "2021"
opentelemetry = { path = "../../../opentelemetry" }
opentelemetry_sdk = { path = "../../../opentelemetry-sdk", features = ["rt-tokio", "jaeger_remote_sampler"] }
opentelemetry-stdout = { path = "../../../opentelemetry-stdout", features = ["trace"] }
reqwest = "0.11.10"
tokio = { version = "1.18", features = ["macros", "rt-multi-thread"] }
reqwest = { workspace = true }
tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
28 changes: 14 additions & 14 deletions opentelemetry-jaeger/src/exporter/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,20 @@ fn build_config_and_process(
(config, Process { service_name, tags })
}

pub(crate) fn install_tracer_provider_and_get_tracer(
tracer_provider: TracerProvider,
) -> Result<Tracer, TraceError> {
let tracer = opentelemetry::trace::TracerProvider::versioned_tracer(
&tracer_provider,
"opentelemetry-jaeger",
Some(env!("CARGO_PKG_VERSION")),
Some(semcov::SCHEMA_URL),
None,
);
let _ = global::set_tracer_provider(tracer_provider);
Ok(tracer)
}

#[cfg(test)]
mod tests {
use crate::exporter::config::build_config_and_process;
Expand Down Expand Up @@ -115,17 +129,3 @@ mod tests {
env::set_var("OTEL_SERVICE_NAME", "")
}
}

pub(crate) fn install_tracer_provider_and_get_tracer(
tracer_provider: TracerProvider,
) -> Result<Tracer, TraceError> {
let tracer = opentelemetry::trace::TracerProvider::versioned_tracer(
&tracer_provider,
"opentelemetry-jaeger",
Some(env!("CARGO_PKG_VERSION")),
Some(semcov::SCHEMA_URL),
None,
);
let _ = global::set_tracer_provider(tracer_provider);
Ok(tracer)
}
6 changes: 3 additions & 3 deletions opentelemetry-jaeger/tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ mod tests {
.collect::<Vec<&jaeger_api::SpanRef>>();
if let Some(parent_span) = parent_span {
assert_eq!(parent.len(), 1);
let parent = parent.get(0).unwrap();
let parent = parent.first().unwrap();
assert_eq!(parent.span_id, parent_span.span_id);
assert_eq!(parent.trace_id, parent_span.trace_id);
} else {
Expand All @@ -217,10 +217,10 @@ mod tests {
.filter(|kvs| kvs.key == "otel.library.name" || kvs.key == "otel.library.version")
.collect::<Vec<&jaeger_api::KeyValue>>();
assert_eq!(library_metadata.len(), 2);
if library_metadata.get(0).unwrap().key != "otel.library.name" {
if library_metadata.first().unwrap().key != "otel.library.name" {
library_metadata.swap(0, 1)
}
assert_eq!(library_metadata.get(0).unwrap().v_str, library_name.into());
assert_eq!(library_metadata.first().unwrap().v_str, library_name.into());
assert_eq!(
library_metadata.get(1).unwrap().v_str,
library_version.into()
Expand Down
30 changes: 15 additions & 15 deletions opentelemetry-otlp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,33 +26,33 @@ all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
async-trait = "0.1"
futures-core = "0.3"
grpcio = { version = "0.12", optional = true }
async-trait = { workspace = true }
futures-core = { workspace = true }
grpcio = { workspace = true, optional = true }
opentelemetry = { version = "0.21", default-features = false, path = "../opentelemetry" }
opentelemetry_sdk = { version = "0.21", default-features = false, path = "../opentelemetry-sdk" }
opentelemetry-http = { version = "0.10", path = "../opentelemetry-http", optional = true }
opentelemetry-proto = { version = "0.4", path = "../opentelemetry-proto", default-features = false }
opentelemetry-semantic-conventions = { version = "0.13", path = "../opentelemetry-semantic-conventions" }

prost = { version = "0.11.0", optional = true }
tonic = { version = "0.9.0", optional = true }
tokio = { version = "1.0", features = ["sync", "rt"], optional = true }
prost = { workspace = true, optional = true }
tonic = { workspace = true, optional = true }
tokio = { workspace = true, features = ["sync", "rt"], optional = true }

reqwest = { version = "0.11", optional = true, default-features = false }
surf = { version = "2.0", optional = true, default-features = false }
http = { version = "0.2", optional = true }
serde = { version = "1.0", features = ["derive"], optional = true }
thiserror = "1.0"
reqwest = { workspace = true, optional = true, default-features = false }
surf = { workspace = true, optional = true, default-features = false }
http = { workspace = true, optional = true }
serde = { workspace = true, features = ["derive"], optional = true }
thiserror = { workspace = true }

[dev-dependencies]
tokio-stream = { version = "0.1", features = ["net"] }
tokio-stream = { workspace = true, features = ["net"] }
# need tokio runtime to run smoke tests.
opentelemetry_sdk = { features = ["trace", "rt-tokio", "testing"], path = "../opentelemetry-sdk" }
time = { version = "0.3", features = ["macros"] }
tokio = { version = "1.0", features = ["macros", "rt-multi-thread"] }
futures-util = { version = "0.3", default-features = false }
temp-env = "0.3.6"
tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
futures-util = { workspace = true, default-features = false }
temp-env = { workspace = true }

[features]
# telemetry pillars and functions
Expand Down
8 changes: 4 additions & 4 deletions opentelemetry-otlp/examples/basic-otlp-http/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ opentelemetry-otlp = { path = "../..", features = ["http-proto", "reqwest-client
opentelemetry-appender-tracing = { path = "../../../opentelemetry-appender-tracing", default-features = false}
opentelemetry-semantic-conventions = { path = "../../../opentelemetry-semantic-conventions" }

tokio = { version = "1.0", features = ["full"] }
tracing-subscriber = { version = "0.3.0", default-features = false, features = ["registry", "std"] }
tracing = { version = "0.1.37", default-features = false, features = ["std"] }
tracing-core = "0.1.31"
tokio = { workspace = true, features = ["full"] }
tracing-subscriber = { workspace = true, default-features = false, features = ["registry", "std"] }
tracing = { workspace = true, default-features = false, features = ["std"] }
tracing-core = { workspace = true }
2 changes: 1 addition & 1 deletion opentelemetry-otlp/examples/basic-otlp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ opentelemetry-otlp = { path = "../../../opentelemetry-otlp", features = ["tonic"
opentelemetry-semantic-conventions = { path = "../../../opentelemetry-semantic-conventions" }
tokio = { version = "1.0", features = ["full"] }
opentelemetry-appender-log = { path = "../../../opentelemetry-appender-log", default-features = false}
log = {version = "0.4.17"}
log = { workspace = true }

0 comments on commit 731901c

Please sign in to comment.