Package io.prometheus.metrics.config
Class PrometheusProperties
Object
PrometheusProperties
The Prometheus Java client library can be configured at runtime (e.g. using a properties file).
This class represents the runtime configuration.
-
Constructor Summary
ConstructorDescriptionPrometheusProperties
(MetricsProperties defaultMetricsProperties, Map<String, MetricsProperties> metricProperties, ExemplarsProperties exemplarProperties, ExporterProperties exporterProperties, ExporterFilterProperties exporterFilterProperties, ExporterHttpServerProperties httpServerConfig, ExporterPushgatewayProperties pushgatewayProperties, ExporterOpenTelemetryProperties otelConfig) -
Method Summary
Modifier and TypeMethodDescriptionstatic PrometheusProperties
get()
Get the properties instance.The default metric properties apply for metrics wheregetMetricProperties(String)
isnull
.getMetricProperties
(String metricName) Properties specific for one metric.
-
Constructor Details
-
PrometheusProperties
public PrometheusProperties(MetricsProperties defaultMetricsProperties, Map<String, MetricsProperties> metricProperties, ExemplarsProperties exemplarProperties, ExporterProperties exporterProperties, ExporterFilterProperties exporterFilterProperties, ExporterHttpServerProperties httpServerConfig, ExporterPushgatewayProperties pushgatewayProperties, ExporterOpenTelemetryProperties otelConfig)
-
-
Method Details
-
get
Get the properties instance. When called for the first time,get()
loads the properties from the following locations:prometheus.properties
file found in the classpath.- Properties file specified in the
PROMETHEUS_CONFIG
environment variable or theprometheus.config
system property. - Individual properties from system properties.
- Throws:
PrometheusPropertiesException
-
getDefaultMetricProperties
The default metric properties apply for metrics wheregetMetricProperties(String)
isnull
. -
getMetricProperties
Properties specific for one metric. Should be merged withgetDefaultMetricProperties()
. May returnnull
if no metric-specific properties are configured for a metric name. -
getExemplarProperties
-
getExporterProperties
-
getExporterFilterProperties
-
getExporterHttpServerProperties
-
getExporterPushgatewayProperties
-
getExporterOpenTelemetryProperties
-