Skip to content

Commit

Permalink
fix: Backport opentelemetry 0.18 code from main repo (#9)
Browse files Browse the repository at this point in the history
## Motivation
I noticed that this repo got the cut-off before opentelemetry 0.18 was
committed into the main repo so I tried to backport what was there.

## Solution
This is pretty much a backport from the code that @jtescher did on the
main repo.

Let me know if you see something wrong, I tried to adapt the rejections
the best way possible.

This fix #8

---------

Signed-off-by: Jayson Reis <[email protected]>
Co-authored-by: Julian Tescher <[email protected]>
  • Loading branch information
jaysonsantos and jtescher authored May 22, 2023
1 parent bd7d8f6 commit a5c27f6
Show file tree
Hide file tree
Showing 9 changed files with 287 additions and 262 deletions.
6 changes: 3 additions & 3 deletions 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 = { version = "0.1.35", default-features = false, features = ["std"] }
tracing-core = "0.1.28"
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"
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 }
Expand Down
4 changes: 2 additions & 2 deletions 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
2 changes: 1 addition & 1 deletion examples/opentelemetry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,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
Loading

0 comments on commit a5c27f6

Please sign in to comment.