Skip to content

Commit

Permalink
Backport v0.18 otel release changes (#22)
Browse files Browse the repository at this point in the history
Backport other release changes from
tokio-rs/tracing#2312
  • Loading branch information
jtescher committed May 23, 2023
1 parent a5c27f6 commit 0478b0e
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 18 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,17 @@
# 0.18.0 (September 18, 2022)

### Breaking Changes

- Upgrade to `v0.18.0` of `opentelemetry` ([#2303])
For list of breaking changes in OpenTelemetry, see the
[v0.18.0 changelog](https://github.com/open-telemetry/opentelemetry-rust/blob/main/opentelemetry/CHANGELOG.md#v0180).

### Fixed

- `on_event` respects event's explicit parent ([#2296])

Thanks to @wprzytula for contributing to this release!

# 0.17.4 (July 1, 2022)

This release adds optional support for recording `std::error::Error`s using
Expand Down
5 changes: 2 additions & 3 deletions Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "tracing-opentelemetry"
version = "0.17.4"
version = "0.18.0"
authors = [
"Julian Tescher <julian@tescher.me>",
"Tokio Contributors <team@tokio.rs>"
Expand Down Expand Up @@ -40,11 +40,10 @@ thiserror = { version = "1.0.31", optional = true }
async-trait = "0.1.56"
criterion = { version = "0.3.6", default-features = false }
opentelemetry-jaeger = "0.17.0"
tracing = { version = "0.1.35", default-features = false, features = ["std", "attributes"] }
tracing-subscriber = { version = "0.3.0", default-features = false, features = ["registry", "std"] }
futures-util = { version = "0.3", default-features = false }
tokio = { version = "1", features = ["full"] }
tokio-stream = "0.1"
tracing = { version = "0.1.35", default-features = false, features = ["std", "attributes"] }

[lib]
bench = false
Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -17,9 +17,9 @@ Utilities for adding [OpenTelemetry] interoperability to [`tracing`].
[Documentation][docs-url] | [Chat][discord-url]

[crates-badge]: https://img.shields.io/crates/v/tracing-opentelemetry.svg
[crates-url]: https://crates.io/crates/tracing-opentelemetry/0.17.4
[crates-url]: https://crates.io/crates/tracing-opentelemetry/0.18.0
[docs-badge]: https://docs.rs/tracing-opentelemetry/badge.svg
[docs-url]: https://docs.rs/tracing-opentelemetry/0.17.4/tracing_opentelemetry
[docs-url]: https://docs.rs/tracing-opentelemetry/0.18.0/tracing_opentelemetry
[docs-master-badge]: https://img.shields.io/badge/docs-master-blue
[docs-master-url]: https://tracing-rs.netlify.com/tracing_opentelemetry
[mit-badge]: https://img.shields.io/badge/license-MIT-blue.svg
Expand Down
17 changes: 5 additions & 12 deletions src/layer.rs
Expand Up @@ -77,7 +77,7 @@ where
//
// See https://github.com/tokio-rs/tracing/blob/4dad420ee1d4607bad79270c1520673fa6266a3d/tracing-error/src/layer.rs
pub(crate) struct WithContext(
#[allow(clippy::type_complexity)] // who cares
#[allow(clippy::type_complexity)]
fn(&tracing::Dispatch, &span::Id, f: &mut dyn FnMut(&mut OtelData, &dyn PreSampledTracer)),
);

Expand Down Expand Up @@ -971,7 +971,10 @@ fn thread_id_integer(id: thread::ThreadId) -> u64 {
mod tests {
use super::*;
use crate::OtelData;
use opentelemetry::trace::{noop, TraceFlags};
use opentelemetry::{
trace::{noop, TraceFlags},
StringValue,
};
use std::{
borrow::Cow,
collections::HashMap,
Expand Down Expand Up @@ -1093,16 +1096,6 @@ mod tests {
tracing::subscriber::with_default(subscriber, || {
tracing::debug_span!("static_name", otel.name = dynamic_name.as_str());
});
let recorded_status = tracer
.0
.lock()
.unwrap()
.as_ref()
.unwrap()
.builder
.status
.clone();
assert_eq!(recorded_status, otel::Status::Unset);

let recorded_name = tracer
.0
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Expand Up @@ -100,7 +100,7 @@
//! [subscriber]: tracing_subscriber::subscribe
#![deny(unreachable_pub)]
#![cfg_attr(test, deny(warnings))]
#![doc(html_root_url = "https://docs.rs/tracing-opentelemetry/0.17.4")]
#![doc(html_root_url = "https://docs.rs/tracing-opentelemetry/0.18.0")]
#![doc(
html_logo_url = "https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png",
issue_tracker_base_url = "https://github.com/tokio-rs/tracing/issues/"
Expand Down

0 comments on commit 0478b0e

Please sign in to comment.