Interface Collector
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
To be registered with the Prometheus collector registry.
See Overall Structure on
https://prometheus.io/docs/instrumenting/writing_clientlibs/.
-
Method Summary
Modifier and TypeMethodDescriptioncollect()Called when the Prometheus server scrapes metrics.default MetricSnapshotdefault StringOverride this and returnnullif a collector does not have a constant name, or if you don't want this library to callcollect()during registration of this collector.
-
Method Details
-
collect
Called when the Prometheus server scrapes metrics. -
collect
Likecollect(), but returnsnullifincludedNames.test(name)isfalse.Override this if there is a more efficient way than first collecting the snapshot and then discarding it.
-
getPrometheusName
Override this and returnnullif a collector does not have a constant name, or if you don't want this library to callcollect()during registration of this collector.
-