Interface ConfigProperties
public interface ConfigProperties
Properties used for auto-configuration of the OpenTelemetry SDK components.
-
Method Summary
Modifier and TypeMethodDescriptiongetBoolean
(String name) Returns a boolean-valued configuration property.Returns a double-valued configuration property.getDuration
(String name) Returns a duration property from the map, ornull
if it cannot be found or it has a wrong type.Returns a integer-valued configuration property.Returns a list-valued configuration property.Returns a long-valued configuration property.Returns a map-valued configuration property.Returns a string-valued configuration property.
-
Method Details
-
getString
Returns a string-valued configuration property.- Returns:
- null if the property has not been configured.
- Throws:
ConfigurationException
- if the property is not a valid string.
-
getBoolean
Returns a boolean-valued configuration property. Implementations should use the same rules asBoolean.parseBoolean(String)
for handling the values.- Returns:
- null if the property has not been configured.
- Throws:
ConfigurationException
- if the property is not a valid boolean.
-
getInt
Returns a integer-valued configuration property.- Returns:
- null if the property has not been configured.
- Throws:
ConfigurationException
- if the property is not a valid integer.
-
getLong
Returns a long-valued configuration property.- Returns:
- null if the property has not been configured.
- Throws:
ConfigurationException
- if the property is not a valid long.
-
getDouble
Returns a double-valued configuration property.- Returns:
- null if the property has not been configured.
- Throws:
ConfigurationException
- if the property is not a valid double.
-
getDuration
Returns a duration property from the map, ornull
if it cannot be found or it has a wrong type.Durations can be of the form "{number}{unit}", where unit is one of:
- ms
- s
- m
- h
- d
If no unit is specified, milliseconds is the assumed duration unit.
- Parameters:
name
- The property name- Returns:
- the
Duration
value of the property,null
if the property cannot be found. - Throws:
ConfigurationException
- for malformed duration strings.
-
getList
Returns a list-valued configuration property. The format of the original value must be comma-separated. Empty values will be removed.- Returns:
- an empty list if the property has not been configured.
- Throws:
ConfigurationException
- if the property is not a valid comma-separated list.
-
getMap
Returns a map-valued configuration property. The format of the original value must be comma-separated for each key, with an '=' separating the key and value. For instance,service.name=Greatest Service,host.name=localhost
Empty values will be removed.- Returns:
- an empty map if the property has not been configured.
- Throws:
ConfigurationException
- for malformed map strings.
-