Class ExemplarReservoir

Inheritance Relationships

Derived Types

Class Documentation

class ExemplarReservoir

An interface for an exemplar reservoir of samples.

This represents a reservoir for a specific “point” of metric data.

Subclassed by opentelemetry::sdk::metrics::FilteredExemplarReservoir, opentelemetry::sdk::metrics::FixedSizeExemplarReservoir, opentelemetry::sdk::metrics::NoExemplarReservoir

Public Functions

virtual ~ExemplarReservoir() = default
virtual void OfferMeasurement(int64_t value, const MetricAttributes &attributes, const opentelemetry::context::Context &context, const opentelemetry::common::SystemTimestamp &timestamp) noexcept = 0

Offers a long measurement to be sampled.

virtual void OfferMeasurement(double value, const MetricAttributes &attributes, const opentelemetry::context::Context &context, const opentelemetry::common::SystemTimestamp &timestamp) noexcept = 0

Offers a double measurement to be sampled.

virtual std::vector<std::shared_ptr<ExemplarData>> CollectAndReset(const MetricAttributes &pointAttributes) noexcept = 0

Builds vector of Exemplars for exporting from the current reservoir.

Additionally, clears the reservoir for the next sampling period.

Parameters:

pointAttributes – the Attributes associated with the metric point. ExemplarDatas should filter these out of their final data state.

Returns:

A vector of sampled exemplars for this point. Implementers are expected to filter out pointAttributes from the original recorded attributes.

Public Static Functions

static nostd::shared_ptr<ExemplarReservoir> GetFilteredExemplarReservoir(std::shared_ptr<ExemplarFilter> filter, std::shared_ptr<ExemplarReservoir> reservoir)
static nostd::shared_ptr<ExemplarReservoir> GetHistogramExemplarReservoir(size_t size, std::shared_ptr<ReservoirCellSelector> reservoir_cell_selector, std::shared_ptr<ExemplarData> (ReservoirCell::* map_and_reset_cell)(const common::OrderedAttributeMap &attributes))
static nostd::shared_ptr<ExemplarReservoir> GetNoExemplarReservoir()