Class PrometheusPropertiesLoader
Configuration is read from a classpath prometheus.properties file, an optional
properties file selected by prometheus.config or PROMETHEUS_CONFIG, Java system
properties, IO_PROMETHEUS_* environment variables, and properties supplied explicitly to
load(Map). Precedence is explicit properties, environment variables, system properties,
the selected file, then the classpath file. PROMETHEUS_CONFIG, when set, takes precedence
over the prometheus.config system property when selecting the optional file. Property
names use dot-separated keys such as io.prometheus.exporter.include_created_timestamps;
environment variable names use underscores, such as
IO_PROMETHEUS_EXPORTER_INCLUDE_CREATED_TIMESTAMPS.
Unrecognized properties under the io.prometheus or io_prometheus prefixes
cause configuration loading to fail, which can help identify misspelled property names.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PrometheusPropertiesload()static PrometheusPropertiesLoads configuration, using the supplied properties in addition to the standard property sources.
-
Constructor Details
-
PrometheusPropertiesLoader
public PrometheusPropertiesLoader()
-
-
Method Details
-
load
- Throws:
PrometheusPropertiesException
-
load
public static PrometheusProperties load(Map<Object, Object> externalProperties) throws PrometheusPropertiesExceptionLoads configuration, using the supplied properties in addition to the standard property sources. Values inexternalPropertiestake precedence over environment variables, system properties, and properties files.- Parameters:
externalProperties- properties supplied by the caller- Returns:
- the loaded configuration
- Throws:
PrometheusPropertiesException- if the selected properties file cannot be read or the configuration contains an invalid or unrecognized property
-