Class MetricProducer

Inheritance Relationships

Derived Type

Class Documentation

class MetricProducer

MetricProducer is the interface that is used to make metric data available to the OpenTelemetry exporters. Implementations should be stateful, in that each call to Collect will return any metric generated since the last call was made.

Implementations must be thread-safe.

Subclassed by opentelemetry::sdk::metrics::MetricCollector

Public Functions

MetricProducer() = default
virtual ~MetricProducer() = default
virtual bool Collect(nostd::function_ref<bool(ResourceMetrics &metric_data)> callback) noexcept = 0

The callback to be called for each metric exporter. This will only be those metrics that have been produced since the last time this method was called.


a status of completion of method.