Class ResourceConfiguration


  • public final class ResourceConfiguration
    extends java.lang.Object
    Auto-configuration for the OpenTelemetry Resource.
    Since:
    1.28.0
    • Field Detail

      • logger

        private static final java.util.logging.Logger logger
      • SERVICE_NAME

        private static final AttributeKey<java.lang.String> SERVICE_NAME
      • SERVICE_NAME_PROPERTY

        static final java.lang.String SERVICE_NAME_PROPERTY
        See Also:
        Constant Field Values
      • EXPERIMENTAL_DISABLED_ATTRIBUTE_KEYS

        static final java.lang.String EXPERIMENTAL_DISABLED_ATTRIBUTE_KEYS
        See Also:
        Constant Field Values
      • DISABLED_ATTRIBUTE_KEYS

        static final java.lang.String DISABLED_ATTRIBUTE_KEYS
        See Also:
        Constant Field Values
    • Constructor Detail

      • ResourceConfiguration

        private ResourceConfiguration()
    • Method Detail

      • createEnvironmentResource

        public static Resource createEnvironmentResource()
        Create a Resource from the environment. The resource contains attributes parsed from environment variables and system property keys otel.resource.attributes and otel.service.name.
        Returns:
        the resource.
      • createEnvironmentResource

        public static Resource createEnvironmentResource​(ConfigProperties config)
        Create a Resource from the environment. The resource contains attributes parsed from environment variables and system property keys otel.resource.attributes and otel.service.name.
        Parameters:
        config - the ConfigProperties used to obtain resource properties
        Returns:
        the resource.