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:
  • AutoConfigurationCustomizerProvider
  • GoogleCredentials
  • Constructor Details

    • GcpAuthAutoConfigurationCustomizerProvider

      public GcpAuthAutoConfigurationCustomizerProvider()
  • Method Details

    • customize

      public void customize(@Nonnull io.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizer autoConfiguration)
      Customizes the provided AutoConfigurationCustomizer such 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 SpanExporter and MetricExporter.
      • If the configured signal specific endpoint is a known GCP Telemetry API endpoint, customizes only the signal specific exporter.
      The 'customization' performed includes customizing the exporters by adding required headers to the export calls made and customizing the resource by adding required resource attributes to enable GCP integration.
      Specified by:
      customize in interface io.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizerProvider
      Parameters:
      autoConfiguration - the AutoConfigurationCustomizer to customize.
    • order

      public int order()
      Specified by:
      order in interface io.opentelemetry.sdk.autoconfigure.spi.Ordered