Class GcpAuthAutoConfigurationCustomizerProvider
java.lang.Object
org.apache.beam.sdk.extensions.opentelemetry.gcp.auth.GcpAuthAutoConfigurationCustomizerProvider
- All Implemented Interfaces:
io.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizerProvider,io.opentelemetry.sdk.autoconfigure.spi.Ordered
@Internal
@AutoService(io.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizerProvider.class)
public class GcpAuthAutoConfigurationCustomizerProvider
extends Object
implements io.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizerProvider
An AutoConfigurationCustomizerProvider for Google Cloud Platform (GCP) OpenTelemetry (OTLP)
integration.
This class is registered as a service provider using AutoService and is responsible
for customizing the OpenTelemetry configuration for GCP specific behavior. It retrieves Google
Application Default Credentials (ADC) and adds them as authorization headers to the configured
SpanExporter. It also sets default properties and resource attributes for GCP
integration.
Copied from https://github.com/open-telemetry/opentelemetry-java-contrib/blob/main/gcp-auth-extension/src/main/java/io/opentelemetry/contrib/gcp/auth/GcpAuthAutoConfigurationCustomizerProvider.java
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcustomize(io.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizer autoConfiguration) Customizes the providedAutoConfigurationCustomizersuch that authenticated exports to GCP Telemetry API are possible from the configured OTLP exporter.intorder()
-
Constructor Details
-
GcpAuthAutoConfigurationCustomizerProvider
public GcpAuthAutoConfigurationCustomizerProvider()
-
-
Method Details
-
customize
public void customize(@Nonnull io.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizer autoConfiguration) Customizes the providedAutoConfigurationCustomizersuch that authenticated exports to GCP Telemetry API are possible from the configured OTLP exporter.This method attempts to retrieve Google Application Default Credentials (ADC) and performs the following:
- Verifies whether the configured OTLP endpoint (base or signal specific) is a known GCP endpoint.
- If the configured base OTLP endpoint is a known GCP Telemetry API endpoint, customizes
both the configured OTLP
SpanExporterandMetricExporter. - If the configured signal specific endpoint is a known GCP Telemetry API endpoint, customizes only the signal specific exporter.
- Specified by:
customizein interfaceio.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizerProvider- Parameters:
autoConfiguration- the AutoConfigurationCustomizer to customize.
-
order
public int order()- Specified by:
orderin interfaceio.opentelemetry.sdk.autoconfigure.spi.Ordered
-