Skip to content

Conversation

BenWhitehead
Copy link
Collaborator

Refactor OpenTelemetryBootstrappingUtils to return a channel configurator function rather than mutating a passed in value.

Add ChannelConfigurator interface to make testing easier and to simplify composition with any existing channel configurator function present in the InstantiatingGrpcChannelProvider.

…t running on gcp

Refactor OpenTelemetryBootstrappingUtils to return a channel configurator function rather than mutating a passed in value.

Add ChannelConfigurator interface to make testing easier and to simplify composition with any existing channel configurator function present in the InstantiatingGrpcChannelProvider.
@BenWhitehead BenWhitehead requested a review from a team as a code owner May 7, 2025 19:56
@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: storage Issues related to the googleapis/java-storage API. labels May 7, 2025
Copy link
Contributor

@cojenco cojenco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Ben!

Comment on lines +104 to +107
if (projectId == null && detectedProjectId == null) {
log.warning(
"Unable to determine the Project ID in order to report metrics. No gRPC client metrics will be reported.");
return channelConfigurator != null ? channelConfigurator : ChannelConfigurator.identity();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

qq: is this the case of not running on GCP?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a round about manner yes. The metrics reporting relies on application default credentials for initialization, and if the project can't be determined either as a passed in value from the Storage client, or resolved from the GCP resolved otel attributes there isn't any way to bootstrap.

@BenWhitehead BenWhitehead merged commit 10cd32d into main May 8, 2025
23 checks passed
@BenWhitehead BenWhitehead deleted the fix/grpc-metrics-graceful branch May 8, 2025 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/java-storage API. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants