-
Notifications
You must be signed in to change notification settings - Fork 593
feat: Add otelcol.auth.google client auth provider #5526
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
a6cebdd
feat: Add otelcol.auth.google client auth provider
dashpole 7a35072
Apply suggestions from code review
dashpole 3db59c2
remove alias
dashpole 5d149b8
fix pointer reuse in config
dashpole e751989
switch to require.Eventually
dashpole c74a860
start the auth extension component synchronously
dashpole 1d75f85
working
dashpole d65a3af
revert wrappers for startup ordering
dashpole 479bbae
update to latest releaes
dashpole 6a202e3
lint
dashpole File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 101 additions & 0 deletions
101
docs/sources/reference/components/otelcol/otelcol.auth.google.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| --- | ||
| canonical: https://grafana.com/docs/alloy/latest/reference/components/otelcol/otelcol.auth.google/ | ||
| description: Learn about otelcol.auth.google | ||
| labels: | ||
| stage: public-preview | ||
| products: | ||
| - oss | ||
| title: otelcol.auth.google | ||
| --- | ||
|
|
||
| # `otelcol.auth.google` | ||
|
|
||
| {{< docs/shared lookup="stability/public_preview.md" source="alloy" version="<ALLOY_VERSION>" >}} | ||
|
|
||
| `otelcol.auth.google` exposes a `handler` that other `otelcol` components can use to authenticate requests using Google Application Default Credentials. | ||
|
|
||
| This component only supports client authentication. | ||
|
|
||
| The authorization tokens can be used by HTTP and gRPC based OpenTelemetry exporters. | ||
| This component can fetch and refresh expired tokens automatically. | ||
| Refer to the [Google Cloud Documentation](https://docs.cloud.google.com/docs/authentication/application-default-credentials) for more information about Application Default Credentials. | ||
|
|
||
| {{< admonition type="note" >}} | ||
| `otelcol.auth.google` is a wrapper over the upstream OpenTelemetry Collector [`googleclientauth`][] extension. | ||
| Bug reports or feature requests will be redirected to the upstream repository, if necessary. | ||
|
|
||
| [`googleclientauth`]: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/{{< param "OTEL_VERSION" >}}/extension/googleclientauthextension | ||
| {{< /admonition >}} | ||
|
|
||
| You can specify multiple `otelcol.auth.google` components by giving them different labels. | ||
|
|
||
| ## Usage | ||
|
|
||
| ```alloy | ||
| otelcol.auth.google "<LABEL>" { | ||
| project = "<PROJECT_ID>" | ||
|
clayton-cornell marked this conversation as resolved.
|
||
| } | ||
| ``` | ||
|
|
||
| ## Arguments | ||
|
|
||
| You can use the following arguments with `otelcol.auth.google`: | ||
|
|
||
| | Name | Type | Description | Default | Required | | ||
| | --------------- | -------------- | ------------------------------------------------------------------ | -------------- | -------- | | ||
| | `audience` | `string` | The audience claim used for generating an ID token. | | no | | ||
| | `project` | `string` | The project telemetry is sent to. | | no | | ||
| | `quota_project` | `string` | A project for quota and billing purposes. | | no | | ||
| | `scopes` | `list(string)` | Requested permissions associated with the client. | `[]` | no | | ||
| | `token_type` | `string` | The type of token to generate. One of `access_token` or `id_token` | `access_token` | no | | ||
|
|
||
| If `project` isn't set, {{< param "PRODUCT_NAME" >}} uses the project from the Application Default Credentials. | ||
|
|
||
|
dashpole marked this conversation as resolved.
|
||
| ## Blocks | ||
|
|
||
| You can use the following blocks with `otelcol.auth.google`: | ||
|
|
||
| | Block | Description | Required | | ||
| | -------------------------------- | -------------------------------------------------------------------------- | -------- | | ||
| | [`debug_metrics`][debug_metrics] | Configures the metrics that this component generates to monitor its state. | no | | ||
|
|
||
| [debug_metrics]: #debug_metrics | ||
|
|
||
| ### `debug_metrics` | ||
|
|
||
| {{< docs/shared lookup="reference/components/otelcol-debug-metrics-block.md" source="alloy" version="<ALLOY_VERSION>" >}} | ||
|
|
||
| ## Exported fields | ||
|
|
||
| The following fields are exported and can be referenced by other components: | ||
|
|
||
| | Name | Type | Description | | ||
| | --------- | -------------------------- | --------------------------------------------------------------- | | ||
| | `handler` | `capsule(otelcol.Handler)` | A value that other components can use to authenticate requests. | | ||
|
|
||
| ## Component health | ||
|
|
||
| `otelcol.auth.google` is only reported as unhealthy if given an invalid configuration. | ||
|
|
||
| ## Debug information | ||
|
|
||
| `otelcol.auth.google` doesn't expose any component-specific debug information. | ||
|
|
||
| ## Example | ||
|
|
||
| This example configures [`otelcol.exporter.otlp`][otelcol.exporter.otlp] to use `otelcol.auth.google` for authentication: | ||
|
|
||
| ```alloy | ||
| otelcol.exporter.otlp "google" { | ||
| client { | ||
| endpoint = "telemetry.googleapis.com" | ||
| auth = otelcol.auth.google.creds.handler | ||
| } | ||
| } | ||
|
|
||
| otelcol.auth.google "creds" { | ||
| project = "myproject" | ||
| } | ||
| ``` | ||
|
|
||
| [otelcol.exporter.otlp]: ../otelcol.exporter.otlp/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.