diff --git a/src/middleware/axum.rs b/src/middleware/axum.rs index 0c5a5ba..0722a44 100644 --- a/src/middleware/axum.rs +++ b/src/middleware/axum.rs @@ -64,12 +64,11 @@ where type Future = ResponseFuture; fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll> { - self.inner.poll_ready(cx).map_err(Into::into) + self.inner.poll_ready(cx) } fn call(&mut self, req: Request) -> Self::Future { use tracing_opentelemetry::OpenTelemetrySpanExt; - let req = req; let span = if self.filter.map_or(true, |f| f(req.uri().path())) { let span = otel_http::http_server::make_span_from_request(&req); let route = http_route(&req); diff --git a/src/otlp.rs b/src/otlp.rs index 4729495..59271ad 100644 --- a/src/otlp.rs +++ b/src/otlp.rs @@ -10,8 +10,6 @@ use opentelemetry_sdk::{ trace::{Sampler, Tracer}, Resource, }; -// #[cfg(feature = "tls")] -// use tonic::transport::ClientTlsConfig; #[must_use] pub fn identity( @@ -40,12 +38,6 @@ where .with_endpoint(endpoint) .with_headers(read_headers_from_env()) .into(), - // #[cfg(feature = "tls")] - // "grpc/tls" => opentelemetry_otlp::new_exporter() - // .tonic() - // .with_tls_config(ClientTlsConfig::new()) - // .with_endpoint(endpoint) - // .into(), _ => opentelemetry_otlp::new_exporter() .tonic() .with_endpoint(endpoint) @@ -135,8 +127,7 @@ fn infer_protocol_and_endpoint( maybe_protocol: Option<&str>, maybe_endpoint: Option<&str>, ) -> (String, String) { - #[cfg_attr(not(feature = "tls"), allow(unused_mut))] - let mut protocol = maybe_protocol.unwrap_or_else(|| { + let protocol = maybe_protocol.unwrap_or_else(|| { if maybe_endpoint.map_or(false, |e| e.contains(":4317")) { "grpc" } else { @@ -144,11 +135,6 @@ fn infer_protocol_and_endpoint( } }); - // #[cfg(feature = "tls")] - // if protocol == "grpc" && maybe_endpoint.unwrap_or("").starts_with("https") { - // protocol = "grpc/tls"; - // } - let endpoint = match protocol { "http/protobuf" => maybe_endpoint.unwrap_or("http://localhost:4318"), //Devskim: ignore DS137138 _ => maybe_endpoint.unwrap_or("http://localhost:4317"), //Devskim: ignore DS137138 @@ -169,25 +155,6 @@ mod tests { #[case(Some("http/protobuf"), None, "http/protobuf", "http://localhost:4318")] //Devskim: ignore DS137138 #[case(Some("grpc"), None, "grpc", "http://localhost:4317")] //Devskim: ignore DS137138 #[case(None, Some("http://localhost:4317"), "grpc", "http://localhost:4317")] - //Devskim: ignore DS137138 - // #[cfg_attr( - // feature = "tls", - // case( - // None, - // Some("https://localhost:4317"), - // "grpc/tls", - // "https://localhost:4317" - // ) - // )] - // #[cfg_attr( - // feature = "tls", - // case( - // Some("grpc/tls"), - // Some("https://localhost:4317"), - // "grpc/tls", - // "https://localhost:4317" - // ) - // )] #[case( Some("http/protobuf"), Some("http://localhost:4318"), //Devskim: ignore DS137138 diff --git a/src/propagation.rs b/src/propagation.rs index 6d5c756..353882b 100644 --- a/src/propagation.rs +++ b/src/propagation.rs @@ -1,7 +1,3 @@ -// Originally retired from davidB/tracing-opentelemetry-instrumentation-sdk -// which is licensed under CC0 1.0 Universal -// https://github.com/davidB/tracing-opentelemetry-instrumentation-sdk/blob/d3609ac2cc699d3a24fbf89754053cc8e938e3bf/LICENSE - use opentelemetry::{ propagation::{ text_map_propagator::FieldIter, Extractor, Injector, TextMapPropagator,