public static interface TelemetryConverter.MetricConsumer<T>
Modifier and Type | Method and Description |
---|---|
Optional<T> |
brokerId(String brokerId)
brokerId gets called once for every new set of new resource metrics message decoded by the TelemetryConverter
and the value of the
Optional returned by this method will get passed through with each call
to consume() for all the metrics corresponding to that set of resource broker id. |
void |
consume(String metricName,
T resource,
TelemetryConverter.DataPoint dataPoint) |
void |
consume(String metricName,
T resource,
TelemetryConverter.Summary summary) |
Optional<T> brokerId(String brokerId)
Optional
returned by this method will get passed through with each call
to consume() for all the metrics corresponding to that set of resource broker id.
This method is provided to a MetricConsumer as a way to optimize resource label handling, and avoid having to repeat the work necessary to parse resource labels with every single metric data point.
If this method returns an emtpy Optional
, the TelemetryConverter will skip metrics associated
with that resource altogether and not call consume for that set of resource labels.
brokerId
- the broker id string; could be null or empty string.void consume(String metricName, T resource, TelemetryConverter.DataPoint dataPoint)
void consume(String metricName, T resource, TelemetryConverter.Summary summary)