public class TelemetryEmitter extends Object implements Emitter, MetricsCollector
TelemetryReporter.configure(java.util.Map<java.lang.String, ?>)
[must be called first & only once]
2. TelemetryReporter.contextChange(org.apache.kafka.common.metrics.MetricsContext)
[must be called second]LABEL_COLLECTOR, LABEL_LIBRARY, LABEL_ORIGINAL, LIBRARY_NONE
Constructor and Description |
---|
TelemetryEmitter(Context context,
Supplier<Collection<Exporter>> exportersSupplier,
Predicate<? super Keyed> metricsPredicate) |
Modifier and Type | Method and Description |
---|---|
void |
collect(Emitter emitter) |
boolean |
emitMetric(SinglePointMetric metric)
Emits a metric to all configured
Exporter
objects. |
void |
reconfigurePredicate(Predicate<? super Keyed> metricsPredicate) |
boolean |
shouldEmitMetric(Keyed key)
Tests whether this metric object could actually be emitted based on its key.
|
public boolean shouldEmitMetric(Keyed key)
Emitter
shouldEmitMetric
in interface Emitter
key
- metric key to test againstpublic boolean emitMetric(SinglePointMetric metric)
Emitter
Exporter
objects.emitMetric
in interface Emitter
metric
- to emitpublic void collect(Emitter emitter)
collect
in interface MetricsCollector