Skip to content

Commit

Permalink
Bump OpenTelemetry and other crates
Browse files Browse the repository at this point in the history
  • Loading branch information
NickAcPT committed Jul 31, 2024
1 parent e621000 commit e621000
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
18 changes: 9 additions & 9 deletions nmsr-aas/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ serde_json = { workspace = true }
base64 = "0.22"

# Hyper - HTTP client
hyper = { version = "1.2.0", features = ["client"] }
hyper = { version = "1.4", features = ["client"] }
hyper-util = { version = "0.1", features = ["client", "client-legacy", "http1", "http2", "server-auto", "tokio"] }
hyper-tls = "0.6"
url = "2.5"
Expand All @@ -62,12 +62,12 @@ tracing = { workspace = true }
tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }

# OpenTelemetry - Tracing framework
opentelemetry = { version = "0.22", features = [] }
opentelemetry_sdk = { version = "0.22", features = ["rt-tokio"] }
opentelemetry-otlp = { version = "0.15", default-features = true }
opentelemetry = { version = "0.24", features = [] }
opentelemetry_sdk = { version = "0.24", features = ["rt-tokio"] }
opentelemetry-otlp = { version = "0.17", default-features = true }

# Tracing OpenTelemetry - Tracing subscriber for OpenTelemetry
tracing-opentelemetry = "0.23"
tracing-opentelemetry = "0.25"

# Strum - Enum helper library
strum = { workspace = true }
Expand All @@ -83,17 +83,17 @@ thiserror = { workspace = true }
derive_more = { workspace = true }

# Tower - Service framework
tower = { version = "0.4", features = ["limit"] }
tower = { version = "0.4", features = ["limit", "timeout"] }
tower-http = { version = "0.5", features = ["full"] }
http = "1.0"
http = "1.1"

# symlink - Symbolic link library (because Rust's standard library doesn't handle that properly for us)
symlink = "0.1"
humantime-serde = "1.1"
serde_with = "3.3"
serde_with = "3.9"
deadpool = { workspace = true }
image = { workspace = true, default-features = false }
mtpng = "0.3"
mtpng = "0.4"

chrono = "0.4"
tokio-stream = { version = "0.1", features = ["fs"] }
Expand Down
16 changes: 10 additions & 6 deletions nmsr-aas/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,13 @@ use anyhow::Context;
use axum::routing::post;
use axum::{routing::get, Router};
use http::HeaderName;
use opentelemetry::trace::TracerProvider;
use opentelemetry::StringValue;
use opentelemetry::{global, KeyValue};
use opentelemetry_otlp::{new_exporter, WithExportConfig};
use opentelemetry_sdk::{propagation::TraceContextPropagator, trace, Resource};
use opentelemetry_sdk::{
propagation::TraceContextPropagator, trace::Config as TracingConfig, Resource,
};
use std::{net::SocketAddr, path::PathBuf};
use tokio::{main, signal};
use tower_http::request_id::MakeRequestUuid;
Expand Down Expand Up @@ -169,13 +172,14 @@ fn setup_tracing(tracing: Option<&TracingConfiguration>) -> anyhow::Result<()> {
let tracer = opentelemetry_otlp::new_pipeline()
.tracing()
.with_exporter(new_exporter().tonic().with_endpoint(&tracing.endpoint))
.with_trace_config(
trace::config().with_resource(Resource::new(vec![KeyValue::new(
.with_trace_config(TracingConfig::default().with_resource(Resource::new(vec![
KeyValue::new(
"service.name",
Into::<StringValue>::into(tracing.service_name.clone()),
)])),
)
.install_batch(opentelemetry_sdk::runtime::Tokio)?;
),
])))
.install_batch(opentelemetry_sdk::runtime::Tokio)?
.tracer("nmsr-aas");

let otel_layer = tracing_subscriber::Layer::with_filter(
tracing_opentelemetry::layer().with_tracer(tracer),
Expand Down

0 comments on commit e621000

Please sign in to comment.