|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * observability/otel/otel-collector/otel-collector-extensions.adoc |
| 4 | + |
| 5 | +:_mod-docs-content-type: REFERENCE |
| 6 | +[id="otel-extensions-oauth2client-extension_{context}"] |
| 7 | += OAuth2Client Extension |
| 8 | + |
| 9 | +[role="_abstract"] |
| 10 | +The OAuth2Client Extension is an authenticator for exporters that are based on the HTTP and the gRPC protocol. |
| 11 | +Client authentication for the OAuth2Client Extension is configured in a separate section in the OpenTelemetry Collector custom resource. |
| 12 | +This extension supports traces, metrics, and logs. |
| 13 | + |
| 14 | +:FeatureName: The OAuth2Client Extension |
| 15 | +include::snippets/technology-preview.adoc[] |
| 16 | + |
| 17 | +.OpenTelemetry Collector custom resource with client authentication configured for the OAuth2Client Extension |
| 18 | +[source,yaml] |
| 19 | +---- |
| 20 | +# ... |
| 21 | + config: |
| 22 | + extensions: |
| 23 | + oauth2client: |
| 24 | + client_id: <client_id> # <1> |
| 25 | + client_secret: <client_secret> # <2> |
| 26 | + endpoint_params: # <3> |
| 27 | + audience: <audience> |
| 28 | + token_url: https://example.com/oauth2/default/v1/token # <4> |
| 29 | + scopes: ["api.metrics"] # <5> |
| 30 | + # tls settings for the token client |
| 31 | + tls: # <6> |
| 32 | + insecure: true # <7> |
| 33 | + ca_file: /var/lib/mycert.pem # <8> |
| 34 | + cert_file: <cert_file> # <9> |
| 35 | + key_file: <key_file> # <10> |
| 36 | + timeout: 2s # <11> |
| 37 | +
|
| 38 | + receivers: |
| 39 | + otlp: |
| 40 | + protocols: |
| 41 | + http: {} |
| 42 | +
|
| 43 | + exporters: |
| 44 | + otlp: |
| 45 | + auth: |
| 46 | + authenticator: oauth2client # <12> |
| 47 | +
|
| 48 | + service: |
| 49 | + extensions: [oauth2client] |
| 50 | + pipelines: |
| 51 | + traces: |
| 52 | + receivers: [otlp] |
| 53 | + exporters: [otlp] |
| 54 | +# ... |
| 55 | +---- |
| 56 | +<1> Client identifier, which is provided by the identity provider. |
| 57 | +<2> Confidential key used to authenticate the client to the identity provider. |
| 58 | +<3> Further metadata, in the key-value pair format, which is transferred during authentication. For example, `audience` specifies the intended audience for the access token, indicating the recipient of the token. |
| 59 | +<4> The URL of the OAuth2 token endpoint, where the Collector requests access tokens. |
| 60 | +<5> The scopes define the specific permissions or access levels requested by the client. |
| 61 | +<6> The Transport Layer Security (TLS) settings for the token client, which is used to establish a secure connection when requesting tokens. |
| 62 | +<7> When set to `true`, configures the Collector to use an insecure or non-verified TLS connection to call the configured token endpoint. |
| 63 | +<8> The path to a Certificate Authority (CA) file that is used to verify the server's certificate during the TLS handshake. |
| 64 | +<9> The path to the client certificate file that the client must use to authenticate itself to the OAuth2 server if required. |
| 65 | +<10> The path to the client's private key file that is used with the client certificate if needed for authentication. |
| 66 | +<11> Sets a timeout for the token client's request. |
| 67 | +<12> You can assign the authenticator configuration to an OTLP exporter. |
0 commit comments