Interface PrometheusMetricsWalker

  • All Known Implementing Classes:
    MetricCollectingWalker

    public interface PrometheusMetricsWalker
    Implementors iterate a collection of metric families and their metrics.
    • Method Detail

      • walkStart

        void walkStart()
        Called when a walk has been started.
      • walkFinish

        void walkFinish​(int familiesProcessed,
                        int metricsProcessed)
        Called when a walk has traversed all the metrics.
        Parameters:
        familiesProcessed - total number of families processed
        metricsProcessed - total number of metrics across all families processed
      • walkMetricFamily

        void walkMetricFamily​(MetricFamily family,
                              int index)
        Called when a new metric family is about to be traversed.
        Parameters:
        family - information about the family being traversed such as the name, help description, etc.
        index - index of the family being processed, where 0 is the first one.
      • walkCounterMetric

        void walkCounterMetric​(MetricFamily family,
                               Counter counter,
                               int index)
        Called when a new counter metric is found.
        Parameters:
        family - information about the family being traversed such as the name, help description, etc.
        counter - the metric being processed
        index - index of the metric being processed, where 0 is the first one.
      • walkGaugeMetric

        void walkGaugeMetric​(MetricFamily family,
                             Gauge gauge,
                             int index)
        Called when a new gauge metric is found.
        Parameters:
        family - information about the family being traversed such as the name, help description, etc.
        gauge - the metric being processed
        index - index of the metric being processed, where 0 is the first one.
      • walkSummaryMetric

        void walkSummaryMetric​(MetricFamily family,
                               Summary summary,
                               int index)
        Called when a new summary metric is found.
        Parameters:
        family - information about the family being traversed such as the name, help description, etc.
        summary - the metric being processed
        index - index of the metric being processed, where 0 is the first one.
      • walkHistogramMetric

        void walkHistogramMetric​(MetricFamily family,
                                 Histogram histogram,
                                 int index)
        Called when a new histogram metric is found.
        Parameters:
        family - information about the family being traversed such as the name, help description, etc.
        histogram - the metric being processed
        index - index of the metric being processed, where 0 is the first one.
      • buildLabelListString

        default String buildLabelListString​(Map<String,​String> labels,
                                            String prefix,
                                            String suffix)
        Convienence method that takes the given label list and returns a string in the form of "labelName1=labelValue1,labelName2=labelValue2,..."
        Parameters:
        labels - the label list
        prefix - if not null, these characters will prefix the label list
        suffix - if not null, these characters will suffix the label list
        Returns:
        the string form of the labels, optionally prefixed and suffixed