Package io.prometheus.metrics.config
Class PrometheusProperties
java.lang.Object
io.prometheus.metrics.config.PrometheusProperties
The Prometheus Java client library can be configured at runtime (e.g. using a properties file).
This class represents the runtime configuration.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class(package private) static classMap that stores metric-specific properties keyed by metric name in exposition format (underscores instead of dots). -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final MetricsPropertiesprivate final ExemplarsPropertiesprivate final ExporterFilterPropertiesprivate final ExporterHttpServerPropertiesprivate final ExporterOpenTelemetryPropertiesprivate final ExporterPropertiesprivate final ExporterPushgatewayPropertiesprivate static final PrometheusPropertiesprivate final PrometheusProperties.MetricPropertiesMapprivate final OpenMetrics2Properties -
Constructor Summary
ConstructorsConstructorDescriptionPrometheusProperties(MetricsProperties defaultMetricsProperties, PrometheusProperties.MetricPropertiesMap metricProperties, ExemplarsProperties exemplarProperties, ExporterProperties exporterProperties, ExporterFilterProperties exporterFilterProperties, ExporterHttpServerProperties httpServerConfig, ExporterPushgatewayProperties pushgatewayProperties, ExporterOpenTelemetryProperties otelConfig, OpenMetrics2Properties openMetrics2Properties) -
Method Summary
Modifier and TypeMethodDescriptionstatic PrometheusProperties.Builderbuilder()static PrometheusPropertiesget()Get the properties instance.The default metric properties apply for metrics wheregetMetricProperties(String)isnull.getMetricProperties(String metricName) Properties specific for one metric.private static booleanisValidLegacyChar(int c, int i)
-
Field Details
-
instance
-
defaultMetricsProperties
-
metricProperties
-
exemplarProperties
-
exporterProperties
-
exporterFilterProperties
-
exporterHttpServerProperties
-
exporterOpenTelemetryProperties
-
exporterPushgatewayProperties
-
openMetrics2Properties
-
-
Constructor Details
-
PrometheusProperties
PrometheusProperties(MetricsProperties defaultMetricsProperties, PrometheusProperties.MetricPropertiesMap metricProperties, ExemplarsProperties exemplarProperties, ExporterProperties exporterProperties, ExporterFilterProperties exporterFilterProperties, ExporterHttpServerProperties httpServerConfig, ExporterPushgatewayProperties pushgatewayProperties, ExporterOpenTelemetryProperties otelConfig, OpenMetrics2Properties openMetrics2Properties)
-
-
Method Details
-
isValidLegacyChar
private static boolean isValidLegacyChar(int c, int i) -
get
Get the properties instance. When called for the first time,get()loads the properties from the following locations:prometheus.propertiesfile found in the classpath.- Properties file specified in the
PROMETHEUS_CONFIGenvironment variable or theprometheus.configsystem property. - Individual properties from system properties.
- Throws:
PrometheusPropertiesException
-
builder
-
getDefaultMetricProperties
The default metric properties apply for metrics wheregetMetricProperties(String)isnull. -
getMetricProperties
Properties specific for one metric. Should be merged withgetDefaultMetricProperties(). May returnnullif no metric-specific properties are configured for a metric name.- Parameters:
metricName- the metric name (dots will be automatically converted to underscores to match exposition format)
-
getExemplarProperties
-
getExporterProperties
-
getExporterFilterProperties
-
getExporterHttpServerProperties
-
getExporterPushgatewayProperties
-
getExporterOpenTelemetryProperties
-
getOpenMetrics2Properties
-