Class PrometheusPropertiesLoader

Object
PrometheusPropertiesLoader

Loads Prometheus client configuration from supported property sources.

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.