Skip to content
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

Default to using FindDeafultCredentials for credentials #527

Merged
merged 2 commits into from Nov 4, 2022

Conversation

dashpole
Copy link
Contributor

@dashpole dashpole commented Nov 4, 2022

This which allows using with workload identity federation as described in https://pkg.go.dev/golang.org/x/oauth2/google#hdr-Credentials.

This combines setProjectFromADC and generateClientOptions to limit startup to a single call to FindDeafultCredentials. It also ensures we only invoke FindDeafultCredentials when both project and impersonate config are already set.

This also fixes a bug with impersonate configuration: It always used the monitoring scopes, even for log and trace exporters. It now uses the correct scopes for the telemetry type.

Fixes #526

@dashpole dashpole requested a review from damemi November 4, 2022 00:04
@dashpole
Copy link
Contributor Author

dashpole commented Nov 4, 2022

cc @avijitsarkar123

Copy link
Member

@damemi damemi left a comment

Choose a reason for hiding this comment

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

2 nits but if there's reasons for them then this lgtm

exporter/collector/metrics.go Show resolved Hide resolved
exporter/collector/traces.go Outdated Show resolved Hide resolved
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.

googlemanagedprometheusexporter auth using metedataserver url
2 participants