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

Merged
merged 4 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

## v0.6.0

- Span name and event name now accept both `&'static str` and `String` (`Into<Cow<'static, str>>`), which previously only accept `&'static str`.
- `with_property` and `with_properties` now accept `impl Into<Cow<'static, str>>`, which previously accept `Cow<'static, str>`.

Expand Down
2 changes: 1 addition & 1 deletion minitrace-datadog/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "minitrace-datadog"
version = "0.5.1"
version = "0.6.0"
authors = ["The TiKV Project Authors"]
license = "Apache-2.0"
edition = "2021"
Expand Down
2 changes: 1 addition & 1 deletion minitrace-jaeger/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "minitrace-jaeger"
version = "0.5.1"
version = "0.6.0"
authors = ["The TiKV Project Authors"]
license = "Apache-2.0"
edition = "2021"
Expand Down
2 changes: 1 addition & 1 deletion minitrace-macro/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "minitrace-macro"
version = "0.5.1"
version = "0.6.0"
authors = ["The TiKV Project Authors"]
license = "Apache-2.0"
edition = "2021"
Expand Down
4 changes: 2 additions & 2 deletions minitrace-opentelemetry/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "minitrace-opentelemetry"
version = "0.5.1"
version = "0.6.0"
authors = ["The TiKV Project Authors"]
license = "Apache-2.0"
edition = "2021"
Expand All @@ -16,7 +16,7 @@ keywords = ["tracing", "span", "datadog", "jaeger", "opentelemetry"]
futures = { version = "0.3", features = ["executor"] }
log = "0.4"
minitrace = { path = "../minitrace" }
opentelemetry = { version = "0.19", features = ["trace"] }
opentelemetry = { version = "0.20", features = ["trace"] }

[dev-dependencies]
opentelemetry-otlp = { version = "0.12", features = ["trace"] }
Expand Down
6 changes: 3 additions & 3 deletions minitrace-opentelemetry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ impl OpenTelemetryReporter {
.iter()
.map(move |span| SpanData {
span_context: SpanContext::new(
span.trace_id.0.to_be_bytes().into(),
span.span_id.0.to_be_bytes().into(),
span.trace_id.0.into(),
span.span_id.0.into(),
TraceFlags::default(),
false,
TraceState::default(),
),
parent_span_id: span.parent_id.0.to_be_bytes().into(),
parent_span_id: span.parent_id.0.into(),
name: span.name.clone(),
start_time: UNIX_EPOCH + Duration::from_nanos(span.begin_time_unix_ns),
end_time: UNIX_EPOCH
Expand Down
14 changes: 7 additions & 7 deletions minitrace/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "minitrace"
version = "0.5.1"
version = "0.6.0"
authors = ["The TiKV Project Authors"]
license = "Apache-2.0"
edition = "2021"
Expand All @@ -17,7 +17,7 @@ enable = []

[dependencies]
futures = "0.3"
minitrace-macro = { version = "0.5.1", path = "../minitrace-macro" }
minitrace-macro = { version = "0.6.0", path = "../minitrace-macro" }
minstant = "0.1"
parking_lot = "0.12"
pin-project = "1"
Expand All @@ -37,13 +37,13 @@ futures-timer = "3"
log = "0.4"
logcall = "0.1.4"
minitrace = { path = ".", features = ["enable"] }
minitrace-datadog = { version = "0.5.1", path = "../minitrace-datadog" }
minitrace-jaeger = { version = "0.5.1", path = "../minitrace-jaeger" }
minitrace-opentelemetry = { version = "0.5.1", path = "../minitrace-opentelemetry" }
minitrace-datadog = { version = "0.6.0", path = "../minitrace-datadog" }
minitrace-jaeger = { version = "0.6.0", path = "../minitrace-jaeger" }
minitrace-opentelemetry = { version = "0.6.0", path = "../minitrace-opentelemetry" }
mockall = "0.11"
once_cell = "1"
opentelemetry = { version = "0.19", features = ["trace"] }
opentelemetry-otlp = { version = "0.12", features = ["trace"] }
opentelemetry = { version = "0.20", features = ["trace"] }
opentelemetry-otlp = { version = "0.13", features = ["trace"] }
rand = "0.8"
rustracing = "0.6"
serial_test = "2"
Expand Down
5 changes: 3 additions & 2 deletions minitrace/examples/asynchronous.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,15 @@ impl ReportAll {
},
opentelemetry_otlp::TonicConfig::default(),
)
.unwrap(),
.expect("initialize oltp exporter"),
opentelemetry::trace::SpanKind::Server,
Cow::Owned(opentelemetry::sdk::Resource::new([
opentelemetry::KeyValue::new("service.name", "asynchronous"),
opentelemetry::KeyValue::new("service.name", "asynchronous(opentelemetry)"),
])),
opentelemetry::InstrumentationLibrary::new(
"example-crate",
Some(env!("CARGO_PKG_VERSION")),
None::<&'static str>,
None,
),
),
Expand Down
5 changes: 3 additions & 2 deletions minitrace/examples/synchronous.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,15 @@ impl ReportAll {
},
opentelemetry_otlp::TonicConfig::default(),
)
.unwrap(),
.expect("initialize oltp exporter"),
opentelemetry::trace::SpanKind::Server,
Cow::Owned(opentelemetry::sdk::Resource::new([
opentelemetry::KeyValue::new("service.name", "synchronous"),
opentelemetry::KeyValue::new("service.name", "synchronous(opentelemetry)"),
])),
opentelemetry::InstrumentationLibrary::new(
"example-crate",
Some(env!("CARGO_PKG_VERSION")),
None::<&'static str>,
None,
),
),
Expand Down
5 changes: 4 additions & 1 deletion minitrace/examples/unit_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ mod test_util {

pub fn closure_name<F: std::any::Any>() -> &'static str {
let full_name = std::any::type_name::<F>();
full_name.rsplit("::").next().unwrap()
full_name
.rsplit("::")
.find(|name| *name != "{{closure}}")
.unwrap()
}
}

Expand Down
Loading