Class PrometheusProperties.MetricPropertiesMap

java.lang.Object
io.prometheus.metrics.config.PrometheusProperties.MetricPropertiesMap
Enclosing class:
PrometheusProperties

static class PrometheusProperties.MetricPropertiesMap extends Object
Map that stores metric-specific properties keyed by metric name in exposition format (underscores instead of dots).

This wrapper makes it explicit that metric names are normalized to underscore format for storage, so that environment variables and properties with dots in metric names can be correctly looked up using normalized names.

  • Field Details

  • Constructor Details

    • MetricPropertiesMap

      MetricPropertiesMap()
  • Method Details

    • set

      void set(Map<String,MetricsProperties> properties)
    • put

      void put(String metricName, MetricsProperties properties)
    • get

      MetricsProperties get(String metricName)
      Get metric properties by metric name.

      Accepts metric names in any format (with dots or underscores) and automatically converts them to the normalized underscore format used for storage.

      Parameters:
      metricName - the metric name (dots will be converted to underscores)
      Returns:
      the metric properties, or null if not configured
    • normalize

      private static String normalize(String name)