Skip to content

declarative config: add declaravite config bridge, gcp auth, span stacktrace #2020

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 39 commits into
base: main
Choose a base branch
from

Conversation

zeitlinger
Copy link
Member

@zeitlinger zeitlinger commented Jul 11, 2025

Blocked by open-telemetry/opentelemetry-configuration#257 for GCP auth

Fixes #2012
Fixes #2028

@zeitlinger zeitlinger requested a review from a team July 11, 2025 10:06
@zeitlinger zeitlinger changed the title gcp auth declarative config: gcp auth Jul 11, 2025
@zeitlinger zeitlinger marked this pull request as draft July 11, 2025 10:07
@otelbot-java-contrib
Copy link
Contributor

🔧 The result from spotlessApply was committed to the PR branch.

@zeitlinger zeitlinger changed the title declarative config: gcp auth declarative config: gcp auth, inferred spans Jul 15, 2025
@zeitlinger zeitlinger changed the title declarative config: gcp auth, inferred spans declarative config: gcp auth, inferred spans, baggage Jul 15, 2025
@zeitlinger zeitlinger changed the title declarative config: gcp auth, inferred spans, baggage declarative config: gcp auth, inferred spans, baggage, span stacktrace Jul 15, 2025
@zeitlinger zeitlinger changed the title declarative config: gcp auth, inferred spans, baggage, span stacktrace declarative config: gcp auth, baggage, span stacktrace Jul 15, 2025
@zeitlinger zeitlinger mentioned this pull request Jul 15, 2025
@zeitlinger zeitlinger changed the title declarative config: gcp auth, baggage, span stacktrace declarative config: gcp auth, span stacktrace Jul 16, 2025
@zeitlinger zeitlinger changed the title declarative config: gcp auth, span stacktrace declarative config: add declaravite config bridge, gcp auth, span stacktrace Jul 22, 2025
Copy link
Member Author

@zeitlinger zeitlinger left a comment

Choose a reason for hiding this comment

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

notes from discussion with @jaydeluca

* string_key: value
* </pre>
*/
final class DeclarativeConfigPropertiesBridge implements ConfigProperties {
Copy link
Member Author

Choose a reason for hiding this comment

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

the bridge is also part of open-telemetry/opentelemetry-java-instrumentation#14184 - once it's reviewed there it will be updated here

but that can also be done after this PR is merged

Copy link
Contributor

@psx95 psx95 left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the the PR @zeitlinger ! 💯

I left some suggestions and a question. Let me know your thoughts on them.

return list;
}

private static void addAuth(
Copy link
Contributor

Choose a reason for hiding this comment

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

Question: The addAuth method seems to add a fixed key-value pair to a list of headers associated with the span exporter / metric exporter.

In this case, I don't see how a token refresh for the auth headers work or am I missing something here ?

Copy link
Member Author

Choose a reason for hiding this comment

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

great catch - I missed the refresh part completely - I have to check how this is even supposed to work


GcpAuthCustomizerProvider.customize(model, credentials, properties);

String header =
Copy link
Contributor

Choose a reason for hiding this comment

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

An additional header that is important to check here is the auth header.
[name=Authorization, value=bearer fake-credential-token].

Sample setup:

mockedRequestMetadata =
        ImmutableMap.of(
              "Authorization",
              Collections.singletonList("Bearer fake-access-token"),
              QUOTA_USER_PROJECT_HEADER,
              Collections.singletonList("qp"));

Mockito.when(mockedGoogleCredentials.getRequestMetadata()).thenReturn(mockedRequestMetadata);

PS: I can update the testing later as well.

zeitlinger and others added 5 commits August 4, 2025 14:46
…auth/GcpAuthAutoConfigurationCustomizerProvider.java

Co-authored-by: Pranav Sharma <[email protected]>
…auth/GcpAuthCustomizerProvider.java

Co-authored-by: Pranav Sharma <[email protected]>
@zeitlinger zeitlinger marked this pull request as draft August 4, 2025 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

declarative config: span stacktrace declarative config: support gcp auth extension
6 participants