Skip to content

Commit

Permalink
deps: bump opentelemetry dependency (#5181)
Browse files Browse the repository at this point in the history
## Description

Updates `opentelemetry-otlp` from 0.13.0 to 0.14.0
Changes `opentelemetry` to `opentelemetry_sdk` dependency and updates to
0.21.0
Changes `opentelemetry_api` to `opentelemetry` and updates to 0.21.0

see open-telemetry/opentelemetry-rust#1186 for
more info

superseeds #4858
  • Loading branch information
jxs authored and guillaumemichel committed Mar 28, 2024
1 parent def3146 commit 190fc82
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 64 deletions.
92 changes: 41 additions & 51 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions examples/metrics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ release = false
futures = "0.3.30"
hyper = { version = "0.14", features = ["server", "tcp", "http1"] }
libp2p = { path = "../../libp2p", features = ["tokio", "metrics", "ping", "noise", "identify", "tcp", "yamux", "macros"] }
opentelemetry = { version = "0.20.0", features = ["rt-tokio", "metrics"] }
opentelemetry-otlp = { version = "0.13.0", features = ["metrics"]}
opentelemetry_api = "0.20.0"
opentelemetry = { version = "0.21.0", features = ["metrics"] }
opentelemetry-otlp = { version = "0.14.0", features = ["metrics"] }
opentelemetry_sdk = { version = "0.21.2", features = ["rt-tokio", "metrics"] }
prometheus-client = { workspace = true }
tokio = { version = "1", features = ["full"] }
tracing = "0.1.37"
tracing-opentelemetry = "0.21.0"
tracing-opentelemetry = "0.22.0"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

[lints]
Expand Down
14 changes: 5 additions & 9 deletions examples/metrics/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ use libp2p::core::Multiaddr;
use libp2p::metrics::{Metrics, Recorder};
use libp2p::swarm::{NetworkBehaviour, SwarmEvent};
use libp2p::{identify, identity, noise, ping, tcp, yamux};
use opentelemetry::sdk;
use opentelemetry_api::KeyValue;
use opentelemetry::KeyValue;
use prometheus_client::registry::Registry;
use std::error::Error;
use std::time::Duration;
Expand Down Expand Up @@ -87,13 +86,10 @@ fn setup_tracing() -> Result<(), Box<dyn Error>> {
let tracer = opentelemetry_otlp::new_pipeline()
.tracing()
.with_exporter(opentelemetry_otlp::new_exporter().tonic())
.with_trace_config(
sdk::trace::Config::default().with_resource(sdk::Resource::new(vec![KeyValue::new(
"service.name",
"libp2p",
)])),
)
.install_batch(opentelemetry::runtime::Tokio)?;
.with_trace_config(opentelemetry_sdk::trace::Config::default().with_resource(
opentelemetry_sdk::Resource::new(vec![KeyValue::new("service.name", "libp2p")]),
))
.install_batch(opentelemetry_sdk::runtime::Tokio)?;

tracing_subscriber::registry()
.with(tracing_subscriber::fmt::layer().with_filter(EnvFilter::from_default_env()))
Expand Down

0 comments on commit 190fc82

Please sign in to comment.