Skip to content

Commit

Permalink
chore: upgrade the opentelemetry libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
etorreborre committed Oct 14, 2024
1 parent 640b3ff commit 8a28790
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 40 deletions.
28 changes: 14 additions & 14 deletions Cargo.lock

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

16 changes: 8 additions & 8 deletions implementations/rust/ockam/ockam_api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ miette = "7"
minicbor = { version = "0.24.1", features = ["alloc", "derive"] }
nix = { version = "0.29", features = ["signal"] }
open = "5.3.0"
opentelemetry = { version = "0.24.0", features = ["logs", "metrics", "trace"] }
opentelemetry-appender-tracing = { version = "0.5.0" }
opentelemetry-otlp = { version = "0.17.0", features = ["logs", "metrics", "trace", "grpc-tonic", "tls", "tls-roots"], default-features = false }
opentelemetry-semantic-conventions = { version = "0.16.0" }
opentelemetry_sdk = { version = "0.24.1", features = ["logs", "metrics", "trace", "rt-tokio", "rt-tokio-current-thread", "testing", "logs_level_enabled"], default-features = false }
opentelemetry = { version = "0.26.0", features = ["logs", "metrics", "trace"] }
opentelemetry-appender-tracing = { version = "0.26.0" }
opentelemetry-otlp = { version = "0.26.0", features = ["logs", "metrics", "trace", "grpc-tonic", "tls", "tls-roots"], default-features = false }
opentelemetry-semantic-conventions = { version = "0.26.0", features = ["semconv_experimental"] }
opentelemetry_sdk = { version = "0.26.0", features = ["logs", "metrics", "trace", "rt-tokio", "rt-tokio-current-thread", "testing", "logs_level_enabled"], default-features = false }
petname = { version = "2.0.2", default-features = false, features = ["default-rng", "default-words"] }
r3bl_rs_utils_core = "0.9"
r3bl_tui = "0.5"
Expand All @@ -107,8 +107,8 @@ tracing = { version = "0.1", default-features = false }
tracing-appender = "0.2.2"
tracing-core = { version = "0.1.32", default-features = false }
tracing-error = "0.2.0"
tracing-opentelemetry = "0.25.0"
tracing-subscriber = { version = "0.3.18", features = ["json"] }
tracing-opentelemetry = "0.27.0"
tracing-subscriber = { version = "0.3", features = ["json"] }
url = "2.5.2"

ockam_multiaddr = { path = "../ockam_multiaddr", version = "0.62.0", features = ["cbor", "serde"] }
Expand Down Expand Up @@ -164,7 +164,7 @@ ockam_macros = { path = "../ockam_macros", features = ["std"], version = "^0.35.
ockam_transport_core = { path = "../ockam_transport_core", version = "^0.92.0" }
ockam_transport_tcp = { path = "../ockam_transport_tcp", default-features = false, version = "^0.125.0" }
once_cell = { version = "1", default-features = false }
opentelemetry_sdk = { version = "0.24.1", features = ["logs", "metrics", "trace", "rt-tokio", "testing"], default-features = false }
opentelemetry_sdk = { version = "0.26.0", features = ["logs", "metrics", "trace", "rt-tokio", "testing"], default-features = false }
pretty_assertions = "1.4.1"
proptest = "1.5.0"
quickcheck = "1.0.1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use ockam_core::async_trait;
use opentelemetry::logs::{LogResult, Severity};
use opentelemetry_sdk::export::logs::{LogData, LogExporter};
use std::borrow::Cow;
use opentelemetry_sdk::export::logs::{LogBatch, LogExporter};
use std::time::Duration;

/// This exporter can be used to intercept the log records sent to an OpenTelemetry collector
Expand All @@ -12,7 +11,7 @@ pub struct DecoratedLogExporter<L: LogExporter> {

#[async_trait]
impl<L: LogExporter> LogExporter for DecoratedLogExporter<L> {
async fn export<'a>(&mut self, batch: Vec<Cow<'a, LogData>>) -> LogResult<()> {
async fn export(&mut self, batch: LogBatch<'_>) -> LogResult<()> {
self.exporter.export(batch).await
}

Expand Down Expand Up @@ -41,7 +40,7 @@ pub struct OckamLogExporter<L: LogExporter> {

#[async_trait]
impl<L: LogExporter> LogExporter for OckamLogExporter<L> {
async fn export<'a>(&mut self, batch: Vec<Cow<'a, LogData>>) -> LogResult<()> {
async fn export(&mut self, batch: LogBatch<'_>) -> LogResult<()> {
match self.log_export_cutoff {
Some(cutoff) => {
let f = self.exporter.export(batch);
Expand Down
11 changes: 3 additions & 8 deletions implementations/rust/ockam/ockam_api/src/logs/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use opentelemetry_sdk::propagation::TraceContextPropagator;
use opentelemetry_sdk::trace::{BatchConfig, BatchConfigBuilder, BatchSpanProcessor};
use opentelemetry_sdk::{self as sdk};
use opentelemetry_sdk::{logs, Resource};
use opentelemetry_semantic_conventions::attribute;
use std::io::{empty, stdout};
use tonic::metadata::*;
use tracing_appender::non_blocking::NonBlocking;
Expand Down Expand Up @@ -428,14 +429,8 @@ fn create_tracer<S: SpanExporter + 'static>(
fn make_resource(app_name: String) -> Resource {
let host_name = gethostname().to_string_lossy().to_string();
Resource::new(vec![
KeyValue::new(
opentelemetry_semantic_conventions::resource::SERVICE_NAME,
"ockam",
),
KeyValue::new(
opentelemetry_semantic_conventions::resource::HOST_NAME,
host_name,
),
KeyValue::new(attribute::SERVICE_NAME, "ockam"),
KeyValue::new(attribute::HOST_NAME, host_name),
KeyValue::new(APP_NAME.clone(), app_name),
])
}
Expand Down
2 changes: 1 addition & 1 deletion implementations/rust/ockam/ockam_command/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ ockam_node = { path = "../ockam_node", version = "^0.127.0" }
ockam_vault = { path = "../ockam_vault", version = "^0.120.0", default-features = false, features = ["storage", "std"] }
once_cell = "1.19"
open = "5.3.0"
opentelemetry = { version = "0.24.0", features = ["metrics", "trace"] }
opentelemetry = { version = "0.26.0", features = ["metrics", "trace"] }
pem-rfc7468 = { version = "0.7.0", features = ["std"] }
r3bl_rs_utils_core = "0.9.12"
r3bl_tui = "0.5.8"
Expand Down
4 changes: 2 additions & 2 deletions implementations/rust/ockam/ockam_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ miette = { version = "7", optional = true }
minicbor = { version = "0.24.1", features = ["derive"] }
ockam_macros = { path = "../ockam_macros", version = "^0.35.0", default-features = false }
once_cell = { version = "1", optional = true, default-features = false }
opentelemetry = { version = "0.24.0", features = ["logs", "metrics", "trace"], optional = true }
opentelemetry = { version = "0.26.0", features = ["logs", "metrics", "trace"], optional = true }
rand = { version = "0.8", default-features = false }
rand_pcg = { version = "0.3.1", default-features = false, optional = true }
regex = { version = "1.10.6", default-features = false, optional = true }
Expand All @@ -94,7 +94,7 @@ strum = { version = "0.26.3", default-features = false, features = ["derive"] }
tinyvec = { version = "1.8.0", features = ["rustc_1_57"] }
tracing = { version = "0.1", default-features = false }
tracing-error = { version = "0.2", default-features = false, optional = true }
tracing-opentelemetry = { version = "0.25.0", optional = true }
tracing-opentelemetry = { version = "0.27.0", optional = true }
tracing-subscriber = { version = "0.3", features = ["fmt", "env-filter"], optional = true }
# Wasn't tested on no_std
utcnow = { version = "0.2.5", default-features = false, features = ["fallback"], optional = true }
Expand Down
4 changes: 2 additions & 2 deletions implementations/rust/ockam/ockam_node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ ockam_executor = { path = "../ockam_executor", version = "^0.87.0", default-feat
ockam_macros = { path = "../ockam_macros", version = "^0.35.0" }
ockam_transport_core = { path = "../ockam_transport_core", version = "^0.92.0", default-features = false, optional = true }
once_cell = { version = "1.19.0", optional = true, default-features = false }
opentelemetry = { version = "0.24.0", features = ["logs", "metrics", "trace"], optional = true }
opentelemetry = { version = "0.26.0", features = ["logs", "metrics", "trace"], optional = true }
regex = { version = "1.10.6", default-features = false, optional = true }
serde = { version = "1.0", default-features = false, features = ["derive"] }
serde_json = { version = "1", optional = true }
Expand All @@ -106,7 +106,7 @@ tokio = { version = "1.39", default-features = false, optional = true, features
tokio-retry = { version = "0.3.0", optional = true }
tracing = { version = "0.1", default-features = false }
tracing-error = { version = "0.2", optional = true }
tracing-opentelemetry = { version = "0.25.0", optional = true }
tracing-opentelemetry = { version = "0.27.0", optional = true }
tracing-subscriber = { version = "0.3", features = ["fmt", "env-filter"], optional = true }

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion implementations/rust/ockam/ockam_transport_tcp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ ockam_core = { path = "../ockam_core", version = "^0.118.0" }
ockam_macros = { path = "../ockam_macros", version = "^0.35.0" }
ockam_node = { path = "../ockam_node", version = "^0.127.0" }
ockam_transport_core = { path = "../ockam_transport_core", version = "^0.92.0" }
opentelemetry = { version = "0.24.0", features = ["logs", "metrics", "trace"], optional = true }
opentelemetry = { version = "0.26.0", features = ["logs", "metrics", "trace"], optional = true }
rand = "0.8"
rustls = { version = "0.23", default-features = false }
rustls-native-certs = "0.8"
Expand Down

0 comments on commit 8a28790

Please sign in to comment.