Skip to content

Commit

Permalink
opentelemetry: update otel to 0.18.0 (#2303)
Browse files Browse the repository at this point in the history
## Motivation

Support the latest OpenTelemetry specification.

## Solution

Update `opentelemetry` to the latest `0.18.x` release. Breaking changes
in the metrics spec have removed value recorders and added histograms so
the metrics layer's `value.` prefix has been changed to `histogram.` and
behaves accordingly. Additionally the `PushController` configuration for
the metrics layer has been simplified to accept a `BasicController` that
can act in either push or pull modes. Finally trace sampling in the
sdk's `PreSampledTracer` impl has been updated to match the sampling
logic in open-telemetry/opentelemetry-rust#839.

* Update MSRV to 1.56
* Update examples
* Fix async-trait dep
* Update msrv action

Co-authored-by: Eliza Weisman <[email protected]>
  • Loading branch information
jtescher and hawkw committed Sep 19, 2022
1 parent f653565 commit bd56070
Show file tree
Hide file tree
Showing 11 changed files with 288 additions and 263 deletions.
1 change: 1 addition & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ jobs:
--exclude=tracing-appender
--exclude=tracing-examples
--exclude=tracing-futures
--exclude=tracing-opentelemetry
toolchain: ${{ env.MSRV }}

# TODO: remove this once tracing's MSRV is bumped.
Expand Down
4 changes: 2 additions & 2 deletions examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ inferno = "0.11.6"
tempfile = "3"

# opentelemetry example
opentelemetry = { version = "0.17.0", default-features = false, features = ["trace"] }
opentelemetry-jaeger = "0.16.0"
opentelemetry = { version = "0.18.0", default-features = false, features = ["trace"] }
opentelemetry-jaeger = "0.17.0"

# fmt examples
snafu = "0.6.10"
Expand Down
2 changes: 1 addition & 1 deletion examples/examples/opentelemetry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fn main() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
// Install an otel pipeline with a simple span processor that exports data one at a time when
// spans end. See the `install_batch` option on each exporter's pipeline builder to see how to
// export in batches.
let tracer = opentelemetry_jaeger::new_pipeline()
let tracer = opentelemetry_jaeger::new_agent_pipeline()
.with_service_name("report_example")
.install_simple()?;
let opentelemetry = tracing_opentelemetry::layer().with_tracer(tracer);
Expand Down
8 changes: 4 additions & 4 deletions tracing-opentelemetry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ categories = [
keywords = ["tracing", "opentelemetry", "jaeger", "zipkin", "async"]
license = "MIT"
edition = "2018"
rust-version = "1.46.0"
rust-version = "1.56.0"

[features]
default = ["tracing-log", "metrics"]
# Enables support for exporting OpenTelemetry metrics
metrics = ["opentelemetry/metrics"]

[dependencies]
opentelemetry = { version = "0.17.0", default-features = false, features = ["trace"] }
opentelemetry = { version = "0.18.0", default-features = false, features = ["trace"] }
tracing = { path = "../tracing", version = "0.1.35", default-features = false, features = ["std"] }
tracing-core = { path = "../tracing-core", version = "0.1.28" }
tracing-subscriber = { path = "../tracing-subscriber", version = "0.3.0", default-features = false, features = ["registry", "std"] }
Expand All @@ -39,7 +39,7 @@ thiserror = { version = "1.0.31", optional = true }
[dev-dependencies]
async-trait = "0.1.56"
criterion = { version = "0.3.6", default-features = false }
opentelemetry-jaeger = "0.16.0"
opentelemetry-jaeger = "0.17.0"
futures-util = { version = "0.3", default-features = false }
tokio = { version = "1", features = ["full"] }
tokio-stream = "0.1"
Expand All @@ -53,4 +53,4 @@ harness = false

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
rustdoc-args = ["--cfg", "docsrs"]
4 changes: 2 additions & 2 deletions tracing-opentelemetry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ The crate provides the following types:
[`tracing`]: https://crates.io/crates/tracing
[OpenTelemetry]: https://opentelemetry.io/

*Compiler support: [requires `rustc` 1.49+][msrv]*
*Compiler support: [requires `rustc` 1.56+][msrv]*

[msrv]: #supported-rust-versions

Expand Down Expand Up @@ -110,7 +110,7 @@ $ firefox http://localhost:16686/
## Supported Rust Versions

Tracing Opentelemetry is built against the latest stable release. The minimum
supported version is 1.46. The current Tracing version is not guaranteed to
supported version is 1.56. The current Tracing version is not guaranteed to
build on Rust versions earlier than the minimum supported version.

Tracing follows the same compiler support policies as the rest of the Tokio
Expand Down
Loading

0 comments on commit bd56070

Please sign in to comment.