Class CounterWithCallback.Builder
Object
MetricWithFixedMetadata.Builder<B,M>
Builder
- Enclosing class:
- CounterWithCallback
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
callback
(Consumer<CounterWithCallback.Callback> callback) The_total
suffix will automatically be appended if it's missing.Methods inherited from class MetricWithFixedMetadata.Builder
constLabels, help, labelNames, unit
-
Method Details
-
callback
-
name
The_total
suffix will automatically be appended if it's missing.
In the example above bothCounterWithCallback c1 = CounterWithCallback.builder() .name("events_total") .build(); CounterWithCallback c2 = CounterWithCallback.builder() .name("events") .build();
c1
andc2
would be named"events_total"
in Prometheus.Throws an
IllegalArgumentException
ifMetricMetadata.isValidMetricName(name)
isfalse
.- Overrides:
name
in classMetricWithFixedMetadata.Builder<CounterWithCallback.Builder,
CounterWithCallback>
-
build
- Specified by:
build
in classMetricWithFixedMetadata.Builder<CounterWithCallback.Builder,
CounterWithCallback>
-