Skip to content

Commit

Permalink
fix: Upgrade opentelemetry to 0.21 (#80)
Browse files Browse the repository at this point in the history
Signed-off-by: Joonas Bergius <joonas@cosmonic.com>
  • Loading branch information
joonas committed Jul 26, 2024
1 parent 2906b3f commit 69dac08
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 94 deletions.
119 changes: 34 additions & 85 deletions Cargo.lock

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

10 changes: 6 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ json-patch = { workspace = true }
k8s-openapi = { workspace = true, features = ["v1_28", "schemars"] }
kube = { workspace = true, features = ["runtime", "derive", "default"] }
opentelemetry = { workspace = true }
opentelemetry_sdk = { workspace = true }
opentelemetry-otlp = { workspace = true }
rcgen = { workspace = true }
schemars = { workspace = true }
Expand Down Expand Up @@ -71,12 +72,13 @@ handlebars = "5.1"
json-patch = "1.4.0"
k8s-openapi = { version = "0.20", default-features = false }
kube = { version = "0.87", default-features = false }
opentelemetry = { version = "0.20", features = [
opentelemetry = { version = "0.21", default-features = false }
opentelemetry_sdk = { version = "0.21", features = [
"metrics",
"trace",
"rt-tokio",
] }
opentelemetry-otlp = { version = "0.13", features = ["tokio"] }
]}
opentelemetry-otlp = { version = "0.14", features = ["tokio"] }
rcgen = "0.11"
schemars = "0.8"
secrecy = "0.8"
Expand All @@ -88,7 +90,7 @@ time = "0.3"
tokio = { version = "1", features = ["full"] }
tokio-util = { version = "0.7", features = ["rt"] }
tracing = "0.1"
tracing-opentelemetry = "0.20"
tracing-opentelemetry = "0.22"
tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }
utoipa = { version = "4.1", features = ["axum_extras"] }
uuid = { version = "1", features = ["v5"] }
Expand Down
11 changes: 6 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ use kube::{
client::Client,
CustomResourceExt,
};
use opentelemetry::sdk::{
trace::{self, RandomIdGenerator, Sampler},
Resource as OTELResource,
use opentelemetry::KeyValue;
use opentelemetry_sdk::{
trace::{RandomIdGenerator, Sampler},
Resource,
};
use std::io::IsTerminal;
use std::net::SocketAddr;
Expand Down Expand Up @@ -80,12 +81,12 @@ fn configure_tracing(enabled: bool) -> anyhow::Result<()> {
.tracing()
.with_exporter(opentelemetry_otlp::new_exporter().tonic())
.with_trace_config(
trace::config()
opentelemetry_sdk::trace::config()
.with_sampler(Sampler::AlwaysOn)
.with_id_generator(RandomIdGenerator::default())
.with_max_attributes_per_span(32)
.with_max_events_per_span(32)
.with_resource(OTELResource::new(vec![opentelemetry::KeyValue::new(
.with_resource(Resource::new(vec![KeyValue::new(
"service.name",
"wasmcloud-operator",
)])),
Expand Down

0 comments on commit 69dac08

Please sign in to comment.