Skip to content

Commit

Permalink
fix(deps): update opentelemetry-rust monorepo to 0.27.0 (#147)
Browse files Browse the repository at this point in the history
* fix(deps): update opentelemetry-rust monorepo to 0.27.0

* fix(deps): update rust crate tracing-opentelemetry to 0.28.0

* fix: otel 0.27 tls_config setting

open-telemetry/opentelemetry-rust#2221

Need a trait to access this now

So import it

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Philip Cristiano <git@philipcristiano.com>
  • Loading branch information
renovate[bot] and philipcristiano authored Dec 1, 2024
1 parent 9dfa26a commit 6ce132a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ repository = "https://github.com/philipcristiano/rust_service_conventions"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
opentelemetry = { version = "0.26.0", optional = true }
opentelemetry-otlp = { version = "0.26.0", features = ["trace", "grpc-tonic", "http-proto", "reqwest-rustls", "tls", "tls-roots"], optional = true }
opentelemetry-semantic-conventions = { version = "0.26.0", optional = true}
opentelemetry_sdk = { version = "0.26.0", features = ["rt-tokio"], optional = true }
opentelemetry = { version = "0.27.0", optional = true }
opentelemetry-otlp = { version = "0.27.0", features = ["trace", "grpc-tonic", "http-proto", "reqwest-rustls", "tls", "tls-roots"], optional = true }
opentelemetry-semantic-conventions = { version = "0.27.0", optional = true}
opentelemetry_sdk = { version = "0.27.0", features = ["rt-tokio"], optional = true }
tonic = { version = "0.12.0", features = ["tls", "tls-roots"], optional = true}

tracing-subscriber = { version = "0.3.18", features = ["fmt", "json", "env-filter", "std", "registry"], optional = true }
tracing = { version = "0.1.40", optional = true}
tracing-opentelemetry = { version = "0.27.0", optional = true}
tracing-opentelemetry = { version = "0.28.0", optional = true}

anyhow = {version = "1.0.82", optional = true}
once_cell = { version = "1.19.0", optional = true}
Expand Down
10 changes: 6 additions & 4 deletions src/tracing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ use tracing_subscriber::registry;
use opentelemetry_sdk::trace::Tracer;
use tracing_opentelemetry::OpenTelemetryLayer;

use opentelemetry_otlp::TonicExporterBuilder;
use opentelemetry_otlp::WithTonicConfig;
use tracing_subscriber::prelude::__tracing_subscriber_SubscriberExt;

pub fn setup(level: Level) {
Expand All @@ -30,13 +32,13 @@ pub fn setup(level: Level) {
// Construct Tracer for OpenTelemetryLayer
fn init_tracer() -> Tracer {
use opentelemetry::trace::TracerProvider as _;
use opentelemetry_otlp::TonicExporterBuilder;
use opentelemetry_sdk::trace::TracerProvider;
let tls_config = tonic::transport::ClientTlsConfig::new().with_native_roots();
let exporter = TonicExporterBuilder::default()
let exporter = opentelemetry_otlp::SpanExporter::builder()
.with_tonic()
.with_tls_config(tls_config)
.build_span_exporter()
.expect("Init");
.build()
.expect("Init Exporter");
let provider = TracerProvider::builder()
.with_batch_exporter(exporter, opentelemetry_sdk::runtime::Tokio)
.build();
Expand Down

0 comments on commit 6ce132a

Please sign in to comment.