Skip to content

Commit

Permalink
stackdriver: fix Cargo features for GcpAuthorizer (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
djc authored Mar 18, 2024
1 parent a98f9be commit 4a4f373
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
6 changes: 6 additions & 0 deletions opentelemetry-stackdriver/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions opentelemetry-stackdriver/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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"]
Expand Down
8 changes: 4 additions & 4 deletions opentelemetry-stackdriver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -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<Self, Error> {
let manager = gcp_auth::AuthenticationManager::new()
Expand All @@ -484,7 +484,7 @@ impl GcpAuthorizer {
}
}

#[cfg(feature = "gcp_auth")]
#[cfg(feature = "gcp-authorizer")]
#[async_trait]
impl Authorizer for GcpAuthorizer {
type Error = Error;
Expand Down

0 comments on commit 4a4f373

Please sign in to comment.