Skip to content

Limit targeting of exporters in GCP Auth Extension to GCP endpoints#2899

Open
stankiewicz wants to merge 2 commits into
open-telemetry:mainfrom
stankiewicz:gcp_auth
Open

Limit targeting of exporters in GCP Auth Extension to GCP endpoints#2899
stankiewicz wants to merge 2 commits into
open-telemetry:mainfrom
stankiewicz:gcp_auth

Conversation

@stankiewicz
Copy link
Copy Markdown

Modified GcpAuthAutoConfigurationCustomizerProvider.java :
• Updated isSignalTargeted to verify if the configured endpoint starts with https://telemetry.googleapis.com or https://telemetry.mtls.googleapis.com before targeting it for authentication.
Updated and verified tests:
• Modified GcpAuthAutoConfigurationCustomizerProviderTest.java to use GCP endpoints for positive test cases.
• Added a test case to explicitly verify that localhost endpoints are not targeted for authentication.
• Ran the Gradle checks using Java 21, and all tests passed successfully.

this is breaking change, happy to discuss.

@stankiewicz stankiewicz requested a review from a team as a code owner June 2, 2026 15:09
Copilot AI review requested due to automatic review settings June 2, 2026 15:09
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented Jun 2, 2026

CLA Signed
The committers listed above are authorized under a signed CLA.

@github-actions github-actions Bot requested review from jsuereth and psx95 June 2, 2026 15:10
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates GCP auth auto-configuration to only treat signals as “targeted” when the OTLP endpoint is a Google Cloud Telemetry endpoint, and adjusts tests to match the new targeting behavior.

Changes:

  • Add endpoint-based eligibility check in isSignalTargeted (only telemetry.googleapis.com / telemetry.mtls.googleapis.com).
  • Refactor test cases to reuse a shared OTel properties map and update expected outcomes for non-Google endpoints.
  • Add/adjust parameterized test coverage for mixed/invalid configured target signals.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
gcp-auth-extension/src/main/java/io/opentelemetry/contrib/gcp/auth/GcpAuthAutoConfigurationCustomizerProvider.java Adds endpoint gating so auth customization only applies when exporting to Google telemetry endpoints.
gcp-auth-extension/src/test/java/io/opentelemetry/contrib/gcp/auth/GcpAuthAutoConfigurationCustomizerProviderTest.java Updates/extends test cases to reflect the new endpoint-based targeting behavior and reuses shared OTel properties.

Comment on lines +125 to +138
private static final ImmutableMap<String, String> defaultOtelPropertiesBothExporters =
ImmutableMap.of(
"otel.exporter.otlp.metrics.endpoint",
"https://telemetry.googleapis.com/v1/metrics",
"otel.exporter.otlp.traces.endpoint",
"https://telemetry.googleapis.com/v1/traces",
"otel.traces.exporter",
"otlp",
"otel.metrics.exporter",
"otlp",
"otel.logs.exporter",
"none",
"otel.resource.attributes",
"foo=bar");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants