public static interface TelemetryConverter.MetricConsumer<T>
Modifier and Type | Method and Description |
---|---|
void |
consume(String metricName,
T resource,
TelemetryConverter.DataPoint dataPoint) |
void |
consume(String metricName,
T resource,
TelemetryConverter.Summary summary) |
Optional<T> |
mapResourceLabels(Map<String,String> resourceLabels)
mapResourceLabels gets called once for every new set of new resource labels 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 labels. |
Optional<T> mapResourceLabels(Map<String,String> resourceLabels)
Optional
returned by this method will get passed through with each call
to consume() for all the metrics corresponding to that set of resource labels.
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.
resourceLabels
- set of resource labelsvoid consume(String metricName, T resource, TelemetryConverter.DataPoint dataPoint)
void consume(String metricName, T resource, TelemetryConverter.Summary summary)