Interface MultiCollector

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

Like Collector, but collecting multiple Snapshots at once.
  • Method Summary

    Modifier and Type
    Method
    Description
    Called when the Prometheus server scrapes metrics.
    collect(Predicate<String> includedNames)
    Like collect(), but returns only the snapshots where includedNames.test(name) is true.
    default List<String>
    Override this and return an empty list if the MultiCollector does not return a constant list of names (names may be added / removed between scrapes).
  • Method Details

    • collect

      Called when the Prometheus server scrapes metrics.
    • collect

      default MetricSnapshots collect(Predicate<String> includedNames)
      Like collect(), but returns only the snapshots where includedNames.test(name) is true.

      Override this if there is a more efficient way than first collecting all snapshot and then discarding the excluded ones.

    • getPrometheusNames

      Override this and return an empty list if the MultiCollector does not return a constant list of names (names may be added / removed between scrapes).