Skip to content

Commit

Permalink
build(deps): bump the opentelemetry group with 2 updates (#3356)
Browse files Browse the repository at this point in the history
Bumps the opentelemetry group with 2 updates: [opentelemetry](https://github.com/open-telemetry/opentelemetry-rust) and [opentelemetry_sdk](https://github.com/open-telemetry/opentelemetry-rust).


Updates `opentelemetry` from 0.26.0 to 0.27.0
- [Release notes](https://github.com/open-telemetry/opentelemetry-rust/releases)
- [Commits](open-telemetry/opentelemetry-rust@opentelemetry-0.26.0...opentelemetry-0.27.0)

Updates `opentelemetry_sdk` from 0.26.0 to 0.27.0
- [Release notes](https://github.com/open-telemetry/opentelemetry-rust/releases)
- [Commits](open-telemetry/opentelemetry-rust@opentelemetry_sdk-0.26.0...opentelemetry_sdk-0.27.0)

---
updated-dependencies:
- dependency-name: opentelemetry
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: opentelemetry
- dependency-name: opentelemetry_sdk
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: opentelemetry
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Oliver Gould <ver@buoyant.io>
  • Loading branch information
dependabot[bot] and olix0r authored Nov 22, 2024
1 parent 7b78212 commit d76dda3
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 36 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2873,9 +2873,9 @@ dependencies = [

[[package]]
name = "opentelemetry"
version = "0.26.0"
version = "0.27.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "570074cc999d1a58184080966e5bd3bf3a9a4af650c3b05047c2621e7405cd17"
checksum = "0f3cebff57f7dbd1255b44d8bddc2cebeb0ea677dbaa2e25a3070a91b318f660"
dependencies = [
"futures-core",
"futures-sink",
Expand All @@ -2898,9 +2898,9 @@ dependencies = [

[[package]]
name = "opentelemetry_sdk"
version = "0.26.0"
version = "0.27.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2c627d9f4c9cdc1f21a29ee4bfbd6028fcb8bcf2a857b43f3abdf72c9c862f3"
checksum = "27b742c1cae4693792cc564e58d75a2a0ba29421a34a85b50da92efa89ecb2bc"
dependencies = [
"async-trait",
"futures-channel",
Expand Down
4 changes: 2 additions & 2 deletions linkerd/opentelemetry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ http-body = "0.4"
linkerd-error = { path = "../error" }
linkerd-metrics = { path = "../metrics" }
linkerd-trace-context = { path = "../trace-context" }
opentelemetry = { version = "0.26", default-features = false, features = ["trace"] }
opentelemetry_sdk = { version = "0.26", default-features = false, features = ["trace"] }
opentelemetry = { version = "0.27", default-features = false, features = ["trace"] }
opentelemetry_sdk = { version = "0.27", default-features = false, features = ["trace"] }
opentelemetry-proto = { path = "../../opentelemetry-proto" }
tonic = { version = "0.10", default-features = false, features = [
"prost",
Expand Down
2 changes: 1 addition & 1 deletion linkerd/opentelemetry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,6 @@ fn convert_span(span: ExportSpan) -> Result<SpanData, Error> {
TraceState::NONE,
),
events: Default::default(),
instrumentation_lib: Default::default(),
instrumentation_scope: Default::default(),
})
}
6 changes: 3 additions & 3 deletions opentelemetry-proto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ Vendored from https://github.com/open-telemetry/opentelemetry-rust/.
[dependencies]
tonic = { version = "0.10", features = ["codegen", "prost", "transport"] }
prost = "0.12"
opentelemetry = { version = "0.26", default-features = false, features = ["trace"] }
opentelemetry_sdk = { version = "0.26", default-features = false, features = ["trace"] }
opentelemetry = { version = "0.27", default-features = false, features = ["trace"] }
opentelemetry_sdk = { version = "0.27", default-features = false, features = ["trace"] }

[dev-dependencies]
opentelemetry = { version = "0.26", default-features = false, features = ["trace", "testing"] }
opentelemetry = { version = "0.27", default-features = false, features = ["trace", "testing"] }
tonic-build = { version = "0.10", default-features = false, features = ["prost"] }

[lib]
Expand Down
34 changes: 18 additions & 16 deletions opentelemetry-proto/src/transform/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ impl From<&opentelemetry_sdk::Resource> for ResourceAttributesWithSchema {

impl
From<(
opentelemetry_sdk::InstrumentationLibrary,
opentelemetry::InstrumentationScope,
Option<Cow<'static, str>>,
)> for InstrumentationScope
{
fn from(
data: (
opentelemetry_sdk::InstrumentationLibrary,
opentelemetry::InstrumentationScope,
Option<Cow<'static, str>>,
),
) -> Self {
let (library, target) = data;
let (scope, target) = data;
if let Some(t) = target {
InstrumentationScope {
name: t.to_string(),
Expand All @@ -46,10 +46,12 @@ impl
..Default::default()
}
} else {
let Attributes(attributes) =
Attributes::from(scope.attributes().cloned().collect::<Vec<_>>());
InstrumentationScope {
name: library.name.into_owned(),
version: library.version.map(Cow::into_owned).unwrap_or_default(),
attributes: Attributes::from(library.attributes).0,
name: scope.name().to_string(),
version: scope.version().map(ToString::to_string).unwrap_or_default(),
attributes,
..Default::default()
}
}
Expand All @@ -58,17 +60,17 @@ impl

impl
From<(
&opentelemetry_sdk::InstrumentationLibrary,
&opentelemetry::InstrumentationScope,
Option<Cow<'static, str>>,
)> for InstrumentationScope
{
fn from(
data: (
&opentelemetry_sdk::InstrumentationLibrary,
&opentelemetry::InstrumentationScope,
Option<Cow<'static, str>>,
),
) -> Self {
let (library, target) = data;
let (scope, target) = data;
if let Some(t) = target {
InstrumentationScope {
name: t.to_string(),
Expand All @@ -77,14 +79,12 @@ impl
..Default::default()
}
} else {
let Attributes(attributes) =
Attributes::from(scope.attributes().cloned().collect::<Vec<_>>());
InstrumentationScope {
name: library.name.to_string(),
version: library
.version
.as_ref()
.map(ToString::to_string)
.unwrap_or_default(),
attributes: Attributes::from(library.attributes.clone()).0,
name: scope.name().to_string(),
version: scope.version().map(ToString::to_string).unwrap_or_default(),
attributes,
..Default::default()
}
}
Expand Down Expand Up @@ -121,7 +121,9 @@ impl From<Value> for AnyValue {
Array::I64(vals) => array_into_proto(vals),
Array::F64(vals) => array_into_proto(vals),
Array::String(vals) => array_into_proto(vals),
_ => ArrayValue::default(),
})),
_ => None,
},
}
}
Expand Down
17 changes: 7 additions & 10 deletions opentelemetry-proto/src/transform/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,11 @@ impl ResourceSpans {
schema_url: resource.schema_url.clone().unwrap_or_default(),
scope_spans: vec![ScopeSpans {
schema_url: source_span
.instrumentation_lib
.schema_url
.as_ref()
.instrumentation_scope
.schema_url()
.map(ToString::to_string)
.unwrap_or_default(),
scope: Some((source_span.instrumentation_lib, None).into()),
scope: Some((source_span.instrumentation_scope, None).into()),
spans: vec![Span {
trace_id: source_span.span_context.trace_id().to_bytes().to_vec(),
span_id: source_span.span_context.span_id().to_bytes().to_vec(),
Expand Down Expand Up @@ -153,9 +152,8 @@ pub fn group_spans_by_resource_and_scope(
// Group spans by their instrumentation library
let scope_map = spans.iter().fold(
HashMap::new(),
|mut scope_map: HashMap<&opentelemetry_sdk::InstrumentationLibrary, Vec<&SpanData>>,
span| {
let instrumentation = &span.instrumentation_lib;
|mut scope_map: HashMap<&opentelemetry::InstrumentationScope, Vec<&SpanData>>, span| {
let instrumentation = &span.instrumentation_scope;
scope_map.entry(instrumentation).or_default().push(span);
scope_map
},
Expand Down Expand Up @@ -192,11 +190,10 @@ mod tests {
use opentelemetry::trace::{
SpanContext, SpanId, SpanKind, Status, TraceFlags, TraceId, TraceState,
};
use opentelemetry::KeyValue;
use opentelemetry::{InstrumentationScope, KeyValue};
use opentelemetry_sdk::export::trace::SpanData;
use opentelemetry_sdk::resource::Resource;
use opentelemetry_sdk::trace::{SpanEvents, SpanLinks};
use opentelemetry_sdk::InstrumentationLibrary;
use std::borrow::Cow;
use std::time::{Duration, SystemTime};

Expand All @@ -221,7 +218,7 @@ mod tests {
events: SpanEvents::default(),
links: SpanLinks::default(),
status: Status::Unset,
instrumentation_lib: InstrumentationLibrary::builder(instrumentation_name).build(),
instrumentation_scope: InstrumentationScope::builder(instrumentation_name).build(),
}
}

Expand Down

0 comments on commit d76dda3

Please sign in to comment.