From 4a4f37328179323b15fe9b196cd142e425d3379e Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Mon, 18 Mar 2024 19:39:48 +0100 Subject: [PATCH] stackdriver: fix Cargo features for GcpAuthorizer (#51) --- opentelemetry-stackdriver/CHANGELOG.md | 6 ++++++ opentelemetry-stackdriver/Cargo.toml | 5 +++-- opentelemetry-stackdriver/src/lib.rs | 8 ++++---- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/opentelemetry-stackdriver/CHANGELOG.md b/opentelemetry-stackdriver/CHANGELOG.md index a235c368..21f05d1a 100644 --- a/opentelemetry-stackdriver/CHANGELOG.md +++ b/opentelemetry-stackdriver/CHANGELOG.md @@ -2,6 +2,12 @@ ## vNext +## v0.19.1 + +### Fixed + +- Fixed Cargo features for `GcpAuthorizer` [#51](https://github.com/open-telemetry/opentelemetry-rust-contrib/pull/51) + ## v0.19.0 ### Added diff --git a/opentelemetry-stackdriver/Cargo.toml b/opentelemetry-stackdriver/Cargo.toml index d7fdc437..51c10984 100644 --- a/opentelemetry-stackdriver/Cargo.toml +++ b/opentelemetry-stackdriver/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "opentelemetry-stackdriver" -version = "0.19.0" +version = "0.19.1" description = "A Rust opentelemetry exporter that uploads traces to Google Stackdriver trace." documentation = "https://docs.rs/opentelemetry-stackdriver/" repository = "https://github.com/open-telemetry/opentelemetry-rust-contrib" @@ -32,7 +32,8 @@ futures-util = { version = "0.3", default-features = false, features = ["alloc"] futures-channel = { version = "0.3", default-features = false, features = ["std"] } [features] -default = ["dep:gcp_auth", "tls-native-roots"] +default = ["gcp-authorizer", "tls-native-roots"] +gcp-authorizer = ["dep:gcp_auth"] yup-authorizer = ["hyper-rustls", "dep:yup-oauth2"] tls-native-roots = ["tonic/tls-roots"] tls-webpki-roots = ["tonic/tls-webpki-roots"] diff --git a/opentelemetry-stackdriver/src/lib.rs b/opentelemetry-stackdriver/src/lib.rs index e3558916..a72a5de2 100644 --- a/opentelemetry-stackdriver/src/lib.rs +++ b/opentelemetry-stackdriver/src/lib.rs @@ -38,7 +38,7 @@ use opentelemetry_sdk::{ }; use opentelemetry_semantic_conventions as semconv; use thiserror::Error; -#[cfg(any(feature = "yup-authorizer", feature = "gcp_auth"))] +#[cfg(any(feature = "yup-authorizer", feature = "gcp-authorizer"))] use tonic::metadata::MetadataValue; use tonic::{ transport::{Channel, ClientTlsConfig}, @@ -453,13 +453,13 @@ impl Authorizer for YupAuthorizer { } } -#[cfg(feature = "gcp_auth")] +#[cfg(feature = "gcp-authorizer")] pub struct GcpAuthorizer { manager: gcp_auth::AuthenticationManager, project_id: String, } -#[cfg(feature = "gcp_auth")] +#[cfg(feature = "gcp-authorizer")] impl GcpAuthorizer { pub async fn new() -> Result { let manager = gcp_auth::AuthenticationManager::new() @@ -484,7 +484,7 @@ impl GcpAuthorizer { } } -#[cfg(feature = "gcp_auth")] +#[cfg(feature = "gcp-authorizer")] #[async_trait] impl Authorizer for GcpAuthorizer { type Error = Error;