Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update dependencies #279

Merged
merged 3 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ dotenvy = "0.15.5"
# Tracing
tracing = { workspace = true }
tracing-subscriber = { version = "0.3.17", features = ["env-filter", "json"] }
opentelemetry-semantic-conventions = "0.15.0"
opentelemetry = { version = "0.23.0", features = ["trace", "metrics", "logs"], optional = true }
opentelemetry_sdk = { version = "0.23.0", features = ["tokio", "rt-tokio", "metrics", "logs", "trace"], optional = true }
opentelemetry-otlp = { version = "0.16.0", features = ["metrics", "trace", "logs"], optional = true }
tracing-opentelemetry = { version = "0.24.0", features = ["metrics"], optional = true }
opentelemetry-semantic-conventions = "0.16.0"
opentelemetry = { version = "0.24.0", features = ["trace", "metrics", "logs"], optional = true }
opentelemetry_sdk = { version = "0.24.1", features = ["tokio", "rt-tokio", "metrics", "logs", "trace"], optional = true }
opentelemetry-otlp = { version = "0.17.0", features = ["metrics", "trace", "logs"], optional = true }
tracing-opentelemetry = { version = "0.25.0", features = ["metrics"], optional = true }

# Controllers
# `axum` is not optional because we use the `FromRef` trait pretty extensively, even in parts of
Expand Down Expand Up @@ -98,7 +98,7 @@ chrono = { version = "0.4.34", features = ["serde"] }
byte-unit = { version = "5.0.0", features = ["serde"] }
convert_case = "0.6.0"
const_format = "0.2.30"
typed-builder = "0.18.0"
typed-builder = "0.19.0"
num-traits = "0.2.14"
validator = { version = "0.18.0", features = ["derive"] }
thiserror = "1.0.38"
Expand All @@ -109,7 +109,7 @@ time = "0.3.36"
[dev-dependencies]
cargo-husky = { version = "1.5.0", default-features = false, features = ["user-hooks"] }
insta = { workspace = true }
mockall = "0.12.1"
mockall = "0.13.0"
mockall_double = "0.3.1"
rstest = { workspace = true }

Expand All @@ -130,7 +130,7 @@ schemars = "0.8.16"
clap = { version = "4.3.0", features = ["derive"] }

# gRPC
tonic = { version = "0.11.0" }
tonic = { version = "0.12.0" }

# Sidekiq
# Todo: the default `rss-stats` feature has a dependency that currently can't be satisfied (memchr: ~2.3)
Expand All @@ -142,7 +142,7 @@ rstest = { version = "0.21.0" }

# Others
# Todo: minimize tokio features included in `roadster`
tokio = { version = "1.28.0", features = ["full"] }
tokio = { version = "1.34.0", features = ["full"] }
# For CancellationToken
tokio-util = { version = "0.7.10" }
anyhow = "1.0.69"
Expand Down
6 changes: 3 additions & 3 deletions examples/full/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ schemars = { workspace = true }

# gRPC API
tonic = { workspace = true, optional = true }
tonic-reflection = { version = "0.11.0", optional = true }
prost = { version = "0.12", optional = true }
tonic-reflection = { version = "0.12.0", optional = true }
prost = { version = "0.13", optional = true }

# DB
entity = { path = "entity" }
Expand All @@ -38,7 +38,7 @@ rusty-sidekiq = { version = "0.10.5", default-features = false }
serde = { workspace = true, features = ["derive"] }

[build-dependencies]
tonic-build = "0.11"
tonic-build = "0.12"
vergen = { version = "8.0.0", features = ["git", "gitcl"] }

[[bin]]
Expand Down
1 change: 0 additions & 1 deletion examples/leptos-ssr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ leptos_config = { version = "0.6.3" }
tower = "0.4.13"
tower-http = { version = "0.5", features = ["fs"], optional = true }
wasm-bindgen = "=0.2.92"
http = "1"

# Defines a size-optimized profile for the WASM bundle in release mode
# Commented out here because profiles are ignored for packages that aren't the workspace root
Expand Down
27 changes: 17 additions & 10 deletions src/tracing/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ use crate::app::metadata::AppMetadata;
#[cfg(feature = "otel")]
use convert_case::{Case, Casing};
#[cfg(feature = "otel")]
use opentelemetry::trace::TracerProvider;
#[cfg(feature = "otel")]
use opentelemetry_otlp::WithExportConfig;
#[cfg(feature = "otel")]
use opentelemetry_sdk::metrics::reader::{DefaultAggregationSelector, DefaultTemporalitySelector};
Expand Down Expand Up @@ -74,15 +76,19 @@ pub fn init_tracing(
}

#[cfg(feature = "otel")]
let otel_resource = {
let service_name = config
.tracing
.service_name
.clone()
.or(metadata.name.clone())
.unwrap_or(config.app.name.to_case(Case::Snake));
let service_name = config
.tracing
.service_name
.clone()
.or(metadata.name.clone())
.unwrap_or(config.app.name.to_case(Case::Snake));

let mut resource_metadata = vec![opentelemetry::KeyValue::new(SERVICE_NAME, service_name)];
#[cfg(feature = "otel")]
let otel_resource = {
let mut resource_metadata = vec![opentelemetry::KeyValue::new(
SERVICE_NAME,
service_name.clone(),
)];

if let Some(version) = metadata.version.clone() {
resource_metadata.push(opentelemetry::KeyValue::new(SERVICE_VERSION, version))
Expand All @@ -102,9 +108,10 @@ pub fn init_tracing(
.with_endpoint(otlp_endpoint.to_string()),
)
.with_trace_config(
opentelemetry_sdk::trace::config().with_resource(otel_resource.clone()),
opentelemetry_sdk::trace::Config::default().with_resource(otel_resource.clone()),
)
.install_batch(Tokio)?;
.install_batch(Tokio)?
.tracer(service_name);
// Create a tracing layer with the configured tracer
Some(tracing_opentelemetry::layer().with_tracer(otlp_tracer))
} else {
Expand Down