Class Counter.Builder
- Enclosing class:
Counter
public static class Counter.Builder
extends MetricWithFixedMetadata.Builder<Counter.Builder, Counter>
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Override if there are more properties than just exemplars enabled.The_totalsuffix will automatically be appended if it's missing.Allow Exemplars for this metric.Turn off Exemplars for this metric.Methods inherited from class MetricWithFixedMetadata.Builder
constLabels, help, labelNames, unit
-
Method Details
-
name
The_totalsuffix will automatically be appended if it's missing.
In the example above bothCounter c1 = Counter.builder() .name("events_total") .build(); Counter c2 = Counter.builder() .name("events") .build();c1andc2would be named"events_total"in Prometheus.Throws an
IllegalArgumentExceptionifMetricMetadata.isValidMetricName(name)isfalse.- Overrides:
namein classMetricWithFixedMetadata.Builder<Counter.Builder, Counter>
-
build
- Specified by:
buildin classMetricWithFixedMetadata.Builder<Counter.Builder, Counter>
-
withExemplars
Allow Exemplars for this metric. -
withoutExemplars
Turn off Exemplars for this metric. -
getDefaultProperties
Override if there are more properties than just exemplars enabled.
-