Interface ConditionalResourceProvider

All Superinterfaces:
Ordered, ResourceProvider

public interface ConditionalResourceProvider extends ResourceProvider
A resource provider that is only applied if the shouldApply(ConfigProperties, Resource) method returns true.

This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.

  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    If an implementation needs to apply only under certain conditions related to the config or the existing state of the Resource being built, they can choose to override this default.

    Methods inherited from interface io.opentelemetry.sdk.autoconfigure.spi.Ordered

    order

    Methods inherited from interface io.opentelemetry.sdk.autoconfigure.spi.ResourceProvider

    createResource
  • Method Details

    • shouldApply

      boolean shouldApply(ConfigProperties config, Resource existing)
      If an implementation needs to apply only under certain conditions related to the config or the existing state of the Resource being built, they can choose to override this default.
      Parameters:
      config - The auto configuration properties
      existing - The current state of the Resource being created
      Returns:
      false to skip over this ResourceProvider, or true to use it