Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
Only the tracing support required changes as the API had changed (or
been deprecated).
  • Loading branch information
tpoliaw committed Dec 13, 2024
1 parent 6b1f42c commit b1ce675
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 31 deletions.
34 changes: 17 additions & 17 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@ license = "Apache-2.0"
unwrap_used = "deny"

[dependencies]
async-graphql = { version = "7.0.12", features = ["tracing"] }
async-graphql-axum = "7.0.12"
axum = "0.7.5"
chrono = "0.4.38"
clap = { version = "4.5.16", features = ["cargo", "derive", "env"] }
futures = "0.3.30"
opentelemetry = "0.24.0"
opentelemetry-otlp = "0.17.0"
opentelemetry-semantic-conventions = "0.16.0"
opentelemetry-stdout = "0.5.0"
opentelemetry_sdk = { version = "0.24.1", features = ["rt-tokio"] }
sqlx = { version = "0.8.0", features = ["runtime-tokio", "sqlite"] }
tokio = { version = "1.39.2", features = ["full"] }
tracing = "0.1.40"
tracing-opentelemetry = "0.25.0"
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
url = "2.5.2"
async-graphql = { version = "7.0.13", features = ["tracing"] }
async-graphql-axum = "7.0.13"
axum = "0.7.9"
chrono = "0.4.39"
clap = { version = "4.5.23", features = ["cargo", "derive", "env"] }
futures = "0.3.31"
opentelemetry = "0.27.1"
opentelemetry-otlp = "0.27.0"
opentelemetry-semantic-conventions = "0.27.0"
opentelemetry-stdout = "0.27.0"
opentelemetry_sdk = { version = "0.27.1", features = ["rt-tokio"] }
sqlx = { version = "0.8.2", features = ["runtime-tokio", "sqlite"] }
tokio = { version = "1.42.0", features = ["full"] }
tracing = "0.1.41"
tracing-opentelemetry = "0.28.0"
tracing-subscriber = { version = "0.3.19", features = ["env-filter"] }
url = "2.5.4"

[dev-dependencies]
async-std = { version = "1.13.0", features = ["attributes"], default-features = false }
Expand Down
26 changes: 12 additions & 14 deletions src/logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@

use opentelemetry::trace::{TraceError, TracerProvider as _};
use opentelemetry::{global, KeyValue};
use opentelemetry_otlp::{new_pipeline, WithExportConfig};
use opentelemetry_sdk::trace::Config;
use opentelemetry_otlp::{SpanExporter, WithExportConfig as _};
use opentelemetry_sdk::trace::TracerProvider;
use opentelemetry_sdk::{runtime, Resource};
use opentelemetry_semantic_conventions::resource::{
DEPLOYMENT_ENVIRONMENT, SERVICE_NAME, SERVICE_VERSION,
};
use opentelemetry_semantic_conventions::resource::{SERVICE_NAME, SERVICE_VERSION};
use opentelemetry_semantic_conventions::SCHEMA_URL;
use tracing::{Level, Subscriber};
use tracing_opentelemetry::OpenTelemetryLayer;
Expand All @@ -37,7 +35,6 @@ fn resource() -> Resource {
[
KeyValue::new(SERVICE_NAME, env!("CARGO_PKG_NAME")),
KeyValue::new(SERVICE_VERSION, env!("CARGO_PKG_VERSION")),
KeyValue::new(DEPLOYMENT_ENVIRONMENT, "dev"),
],
SCHEMA_URL,
)
Expand All @@ -59,15 +56,16 @@ where
S: Subscriber + for<'s> LookupSpan<'s>,
{
if let Some(endpoint) = endpoint {
let provider = new_pipeline()
.tracing()
.with_trace_config(Config::default().with_resource(resource()))
.with_exporter(
opentelemetry_otlp::new_exporter()
.tonic()
.with_endpoint(endpoint),
let provider = TracerProvider::builder()
.with_batch_exporter(
SpanExporter::builder()
.with_tonic()
.with_endpoint(endpoint)
.build()?,
runtime::Tokio,
)
.install_batch(runtime::Tokio)?;
.with_resource(resource())
.build();
global::set_tracer_provider(provider.clone());
let tracer = provider.tracer("visit-service");
Ok(Some(
Expand Down

0 comments on commit b1ce675

Please sign in to comment.