Sum aggregation. Collects the arithmetic sum of measurements.
Stores integer and float components separately for atomic updates.
ETS entry format:
{key, int_value, float_value, start_time, reservoir_state}.
The fifth slot holds the exemplar reservoir state
(Otel.Metrics.Exemplar.Reservoir.SimpleFixedSize). Reservoir
state lives alongside the aggregation cell so a single ETS row
carries everything collect/3 needs to emit a datapoint with
exemplars — there is no separate ExemplarsStorage table.
Cumulative-only — collect/3 returns the running total since
stream start. Delta temporality is not supported (minikube
hardcodes cumulative; spec metrics/sdk.md L1290-L1297 default).
Summary
Functions
@spec aggregate( metrics_tab :: :ets.table(), key :: term(), value :: number(), opts :: map() ) :: :ok
@spec collect( metrics_tab :: :ets.table(), stream_key :: String.t(), opts :: map() ) :: [Otel.Metrics.Aggregation.datapoint()]
@spec offer_exemplar( metrics_tab :: :ets.table(), key :: term(), value :: number(), time :: non_neg_integer(), filtered_attrs :: %{required(String.t()) => term()}, ctx :: Otel.Ctx.t() ) :: :ok