Skip to content

Commit 0478b0e

Browse files
authored
Backport v0.18 otel release changes (#22)
Backport other release changes from tokio-rs/tracing#2312
1 parent a5c27f6 commit 0478b0e

File tree

5 files changed

+24
-18
lines changed

5 files changed

+24
-18
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# 0.18.0 (September 18, 2022)
2+
3+
### Breaking Changes
4+
5+
- Upgrade to `v0.18.0` of `opentelemetry` ([#2303])
6+
For list of breaking changes in OpenTelemetry, see the
7+
[v0.18.0 changelog](https://github.com/open-telemetry/opentelemetry-rust/blob/main/opentelemetry/CHANGELOG.md#v0180).
8+
9+
### Fixed
10+
11+
- `on_event` respects event's explicit parent ([#2296])
12+
13+
Thanks to @wprzytula for contributing to this release!
14+
115
# 0.17.4 (July 1, 2022)
216

317
This release adds optional support for recording `std::error::Error`s using

Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "tracing-opentelemetry"
3-
version = "0.17.4"
3+
version = "0.18.0"
44
authors = [
55
"Julian Tescher <[email protected]>",
66
"Tokio Contributors <[email protected]>"
@@ -40,11 +40,10 @@ thiserror = { version = "1.0.31", optional = true }
4040
async-trait = "0.1.56"
4141
criterion = { version = "0.3.6", default-features = false }
4242
opentelemetry-jaeger = "0.17.0"
43-
tracing = { version = "0.1.35", default-features = false, features = ["std", "attributes"] }
44-
tracing-subscriber = { version = "0.3.0", default-features = false, features = ["registry", "std"] }
4543
futures-util = { version = "0.3", default-features = false }
4644
tokio = { version = "1", features = ["full"] }
4745
tokio-stream = "0.1"
46+
tracing = { version = "0.1.35", default-features = false, features = ["std", "attributes"] }
4847

4948
[lib]
5049
bench = false

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ Utilities for adding [OpenTelemetry] interoperability to [`tracing`].
1717
[Documentation][docs-url] | [Chat][discord-url]
1818

1919
[crates-badge]: https://img.shields.io/crates/v/tracing-opentelemetry.svg
20-
[crates-url]: https://crates.io/crates/tracing-opentelemetry/0.17.4
20+
[crates-url]: https://crates.io/crates/tracing-opentelemetry/0.18.0
2121
[docs-badge]: https://docs.rs/tracing-opentelemetry/badge.svg
22-
[docs-url]: https://docs.rs/tracing-opentelemetry/0.17.4/tracing_opentelemetry
22+
[docs-url]: https://docs.rs/tracing-opentelemetry/0.18.0/tracing_opentelemetry
2323
[docs-master-badge]: https://img.shields.io/badge/docs-master-blue
2424
[docs-master-url]: https://tracing-rs.netlify.com/tracing_opentelemetry
2525
[mit-badge]: https://img.shields.io/badge/license-MIT-blue.svg

src/layer.rs

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ where
7777
//
7878
// See https://github.com/tokio-rs/tracing/blob/4dad420ee1d4607bad79270c1520673fa6266a3d/tracing-error/src/layer.rs
7979
pub(crate) struct WithContext(
80-
#[allow(clippy::type_complexity)] // who cares
80+
#[allow(clippy::type_complexity)]
8181
fn(&tracing::Dispatch, &span::Id, f: &mut dyn FnMut(&mut OtelData, &dyn PreSampledTracer)),
8282
);
8383

@@ -971,7 +971,10 @@ fn thread_id_integer(id: thread::ThreadId) -> u64 {
971971
mod tests {
972972
use super::*;
973973
use crate::OtelData;
974-
use opentelemetry::trace::{noop, TraceFlags};
974+
use opentelemetry::{
975+
trace::{noop, TraceFlags},
976+
StringValue,
977+
};
975978
use std::{
976979
borrow::Cow,
977980
collections::HashMap,
@@ -1093,16 +1096,6 @@ mod tests {
10931096
tracing::subscriber::with_default(subscriber, || {
10941097
tracing::debug_span!("static_name", otel.name = dynamic_name.as_str());
10951098
});
1096-
let recorded_status = tracer
1097-
.0
1098-
.lock()
1099-
.unwrap()
1100-
.as_ref()
1101-
.unwrap()
1102-
.builder
1103-
.status
1104-
.clone();
1105-
assert_eq!(recorded_status, otel::Status::Unset);
11061099

11071100
let recorded_name = tracer
11081101
.0

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
//! [subscriber]: tracing_subscriber::subscribe
101101
#![deny(unreachable_pub)]
102102
#![cfg_attr(test, deny(warnings))]
103-
#![doc(html_root_url = "https://docs.rs/tracing-opentelemetry/0.17.4")]
103+
#![doc(html_root_url = "https://docs.rs/tracing-opentelemetry/0.18.0")]
104104
#![doc(
105105
html_logo_url = "https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png",
106106
issue_tracker_base_url = "https://github.com/tokio-rs/tracing/issues/"

0 commit comments

Comments
 (0)