Class OtlpProperties

java.lang.Object
org.springframework.boot.opentelemetry.autoconfigure.OtlpProperties

@ConfigurationProperties("management.opentelemetry.otlp") public class OtlpProperties extends Object
Common configuration properties for OpenTelemetry Protocol (OTLP) exporters.
Since:
4.2.0
Author:
Somil Jain
  • Constructor Details

    • OtlpProperties

      public OtlpProperties()
  • Method Details

    • getEndpoint

      public @Nullable String getEndpoint()
    • setEndpoint

      public void setEndpoint(@Nullable String endpoint)
    • getHeaders

      public Map<String,String> getHeaders()
    • getCompression

      public @Nullable OtlpProperties.Compression getCompression()
    • setCompression

      public void setCompression(@Nullable OtlpProperties.Compression compression)
    • resolveEndpoint

      public @Nullable String resolveEndpoint(@Nullable String signalEndpoint, @Nullable String path)
      Resolves the endpoint to use, falling back to this common endpoint (with path appended) when signalEndpoint is not set.
      Parameters:
      signalEndpoint - the signal-specific endpoint, or null if not set
      path - the path to append to the common endpoint when used as a fallback, or null if no path should be appended
      Returns:
      the resolved endpoint, or null if neither endpoint is set
    • mergeHeaders

      public Map<String,String> mergeHeaders(Map<String,String> signalHeaders)
      Merges the given signal-specific headers with these common headers. Entries in signalHeaders take precedence over common headers with the same key.
      Parameters:
      signalHeaders - the signal-specific headers
      Returns:
      the merged headers
    • resolveCompression

      public <T> T resolveCompression(@Nullable T signalCompression, T defaultCompression, Function<OtlpProperties.Compression, T> mapper)
      Resolves the compression to use, falling back to this common compression, mapped through mapper, when signalCompression is not set.
      Type Parameters:
      T - the signal-specific compression type
      Parameters:
      signalCompression - the signal-specific compression, or null if not set
      defaultCompression - the compression to use when neither is set
      mapper - maps this common compression to the signal-specific type
      Returns:
      the resolved compression