Class ResourceConfiguration
- java.lang.Object
-
- io.opentelemetry.sdk.autoconfigure.ResourceConfiguration
-
public final class ResourceConfiguration extends java.lang.Object
Auto-configuration for the OpenTelemetryResource
.- Since:
- 1.28.0
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.lang.String
ATTRIBUTE_PROPERTY
(package private) static java.lang.String
DISABLED_ATTRIBUTE_KEYS
(package private) static java.lang.String
EXPERIMENTAL_DISABLED_ATTRIBUTE_KEYS
private static java.util.logging.Logger
logger
private static AttributeKey<java.lang.String>
SERVICE_NAME
(package private) static java.lang.String
SERVICE_NAME_PROPERTY
-
Constructor Summary
Constructors Modifier Constructor Description private
ResourceConfiguration()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static Resource
configureResource(ConfigProperties config, SpiHelper spiHelper, java.util.function.BiFunction<? super Resource,ConfigProperties,? extends Resource> resourceCustomizer)
static Resource
createEnvironmentResource()
Create aResource
from the environment.static Resource
createEnvironmentResource(ConfigProperties config)
Create aResource
from the environment.(package private) static Resource
filterAttributes(Resource resource, ConfigProperties configProperties)
-
-
-
Field Detail
-
logger
private static final java.util.logging.Logger logger
-
SERVICE_NAME
private static final AttributeKey<java.lang.String> SERVICE_NAME
-
ATTRIBUTE_PROPERTY
static final java.lang.String ATTRIBUTE_PROPERTY
- See Also:
- Constant Field Values
-
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
-
-
Method Detail
-
createEnvironmentResource
public static Resource createEnvironmentResource()
Create aResource
from the environment. The resource contains attributes parsed from environment variables and system property keysotel.resource.attributes
andotel.service.name
.- Returns:
- the resource.
-
createEnvironmentResource
public static Resource createEnvironmentResource(ConfigProperties config)
Create aResource
from the environment. The resource contains attributes parsed from environment variables and system property keysotel.resource.attributes
andotel.service.name
.- Parameters:
config
- theConfigProperties
used to obtain resource properties- Returns:
- the resource.
-
configureResource
static Resource configureResource(ConfigProperties config, SpiHelper spiHelper, java.util.function.BiFunction<? super Resource,ConfigProperties,? extends Resource> resourceCustomizer)
-
filterAttributes
static Resource filterAttributes(Resource resource, ConfigProperties configProperties)
-
-