collect method
Collect metrics from the MeterProvider.
This method triggers the collection of metrics, and returns the collected data as an object containing resource and metric information.
Implementation
@override
Future<MetricData> collect() async {
final mp = meterProvider;
if (mp == null || _isShutdown) {
return MetricData.empty();
}
final metrics = await mp.collectAllMetrics();
return MetricData(resource: mp.resource, metrics: metrics);
}