Interface MetricProducer
-
- All Known Implementing Classes:
SdkMeterProvider.LeasedMetricProducer
@ThreadSafe public interface MetricProducerMetricProduceris the interface that is used to make metric data available to theMetricReaders. The primary implementation is provided bySdkMeterProvider.Alternative
MetricProducerimplementations can be used to bridge aggregated metrics from other frameworks, and are registered withSdkMeterProviderBuilder.registerMetricProducer(MetricProducer). NOTE: When possible, metrics from other frameworks SHOULD be bridged using the metric API, normally with asynchronous instruments which observe the aggregated state of the other framework. However,MetricProducerexists to accommodate scenarios where the metric API is insufficient. It should be used with caution as it requires the bridge to take a dependency onopentelemetry-sdk-metrics, which is generally not advised.Implementations must be thread-safe.
- Since:
- 1.31.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Collection<MetricData>produce(Resource resource)Returns a collection of producedMetricDatas to be exported.
-
-
-
Method Detail
-
produce
java.util.Collection<MetricData> produce(Resource resource)
Returns a collection of producedMetricDatas to be exported. This will only be those metrics that have been produced since the last time this method was called.- Returns:
- a collection of produced
MetricDatas to be exported.
-
-