Class FunctionCollectorRegistry

  • Direct Known Subclasses:
    FunctionCollectorRegistryImpl

    public abstract class FunctionCollectorRegistry
    extends io.prometheus.client.CollectorRegistry
    Internal representation of Prometheus Collector Registry
    • Field Summary

      • Fields inherited from class io.prometheus.client.CollectorRegistry

        defaultRegistry
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      static FunctionCollectorRegistry getDefaultImplementation()  
      abstract <T extends io.prometheus.client.Collector>
      T
      registerIfNotExist​(java.lang.String metricName, T collector)
      Register a metric if it does not yet exist.
      • Methods inherited from class io.prometheus.client.CollectorRegistry

        clear, filteredMetricFamilySamples, getSampleValue, getSampleValue, metricFamilySamples, register, unregister
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FunctionCollectorRegistry

        public FunctionCollectorRegistry()
    • Method Detail

      • registerIfNotExist

        public abstract <T extends io.prometheus.client.Collector> T registerIfNotExist​(java.lang.String metricName,
                                                                                        T collector)
        Register a metric if it does not yet exist. If it does exist, then return the existing metric. Currently, only needed by the LocalRunner when running in threaded and exposing metrics via a http server. This method helps resolve the conflict in which multiple instances within the LocalRunner process try to register the same metric.
        Type Parameters:
        T -
        Parameters:
        metricName - the name of the metric
        collector - the metric object e.g. Count, Gauge, etc.
        Returns:
        If the metric with the name `metricName` already exists, return the existing metric object. If not, return null