Interface OtlpConfig

All Superinterfaces:
io.micrometer.core.instrument.config.MeterRegistryConfig, io.micrometer.core.instrument.push.PushRegistryConfig

public interface OtlpConfig extends io.micrometer.core.instrument.push.PushRegistryConfig
Config for OtlpMeterRegistry.
Since:
1.9.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final OtlpConfig
    Configuration with default values.
  • Method Summary

    Modifier and Type
    Method
    Description
    AggregationTemporality of the OtlpMeterRegistry.
    default TimeUnit
     
    default Map<String,String>
    Additional headers to send with exported metrics.
    default String
     
    default Map<String,String>
    Attributes to set on the Resource that will be used for all metrics published.
    default String
    url()
    Defaults to http://localhost:4318/v1/metrics
    default io.micrometer.core.instrument.config.validate.Validated<?>
     

    Methods inherited from interface io.micrometer.core.instrument.config.MeterRegistryConfig

    get, requireValid

    Methods inherited from interface io.micrometer.core.instrument.push.PushRegistryConfig

    batchSize, connectTimeout, enabled, numThreads, readTimeout, step
  • Field Details

    • DEFAULT

      static final OtlpConfig DEFAULT
      Configuration with default values.
  • Method Details

    • prefix

      default String prefix()
      Specified by:
      prefix in interface io.micrometer.core.instrument.config.MeterRegistryConfig
    • url

      default String url()
      Defaults to http://localhost:4318/v1/metrics
      Returns:
      address to where metrics will be published.
    • resourceAttributes

      default Map<String,String> resourceAttributes()
      Attributes to set on the Resource that will be used for all metrics published. This should include a service.name attribute that identifies your service.

      By default, resource attributes will load using the MeterRegistryConfig.get(String) method, extracting key values from a comma-separated list in the format key1=value1,key2=value2. Resource attributes will be loaded from the OTEL_RESOURCE_ATTRIBUTES environment variable and the service name from the OTEL_SERVICE_NAME environment variable if they are set and MeterRegistryConfig.get(String) does not return a value.

      Returns:
      map of key value pairs to use as resource attributes
      See Also:
    • aggregationTemporality

      default AggregationTemporality aggregationTemporality()
      AggregationTemporality of the OtlpMeterRegistry. This determines whether the meters should be cumulative(AGGREGATION_TEMPORALITY_CUMULATIVE) or step/delta(AGGREGATION_TEMPORALITY_DELTA).
      Returns:
      the aggregationTemporality for OtlpMeterRegistry
      Since:
      1.11.0
      See Also:
    • headers

      default Map<String,String> headers()
      Additional headers to send with exported metrics. This may be needed for authorization headers, for example.

      By default, headers will be loaded from MeterRegistryConfig.get(String). If that is not set, they will be taken from the environment variables OTEL_EXPORTER_OTLP_HEADERS and OTEL_EXPORTER_OTLP_METRICS_HEADERS. The header key-value pairs are expected to be in a comma-separated list in the format key1=value1,key2=value2. If a header is set in both OTEL_EXPORTER_OTLP_HEADERS and OTEL_EXPORTER_OTLP_METRICS_HEADERS, the header in the latter will overwrite the former.

      Returns:
      a map of the headers' key-value pairs
      Since:
      1.11.0
      See Also:
    • validate

      default io.micrometer.core.instrument.config.validate.Validated<?> validate()
      Specified by:
      validate in interface io.micrometer.core.instrument.config.MeterRegistryConfig
      Specified by:
      validate in interface io.micrometer.core.instrument.push.PushRegistryConfig
    • baseTimeUnit

      default TimeUnit baseTimeUnit()