Metric Rollup, Supplement
The following supplemental information provides more details of the Kloudfuse implementation for metrics rollup.
For the primary feature description, see Metrics rollup.
Computation
A metrics transformer computes the rollup of each metric series from the Kafka metrics topic (kf_metrics_topic) and writes each rollup resolution to its own Kafka topic: kf_metrics_rollup_300_topic for 5 minutes and kf_metrics_rollup_1800_topic for 30 minutes. Releases before 4.4.0 wrote all rollups to kf_metrics_rollup_topic, which is no longer written to.
Storage
A separate table (kf_metrics_rollup) in the Pinot database stores the rolled up data. While the raw metrics table (kf_metrics) stores a single value column, the schema for kf_metrics_rollup table stores the sum, count, min, max, counter (last counter value that accounts for resets within the rollup window), and first (first value encounter in the bucket). For histogram metrics, the le column stores the collapsed counter values for the histogram buckets, and contains first and counter value for each bucket.
Retention
The kf_metrics_rollup table can keep data for a different time than the raw metric data: the metrics retention policy accepts separate retention settings for rollups, for all rollups or per resolution. If you don’t set them, rollups keep the raw data’s retention. See Retention.
Ingester
The Ingester computes the expiry, and attaches it to the TimeSeries protobuf. The protobuf definition has the additional expiry_rollup field that the ingester populates.
Metrics transformer
The metrics transformer computes the aggregated values: sum, count, min, max, counter (last counter value that accounts for resets within the rollup window), first (first value encounter in the bucket), and first_ts of each metric series.
Decoder
The MetricsRollupDecoder reads from the rollup topics (kf_metrics_rollup_300_topic and kf_metrics_rollup_1800_topic, and the legacy kf_metrics_rollup_topic) and writes to the kf_metrics_rollup table.
Query Service
The query service automatically selects which table to access for the query.
-
If using the rollup feature, the query service routes the query to the correct value column.
For example, for rate, increase, and changes, the query service uses both counter and first values.
-
To handle mixed data, where some (likely older) data has no corresponding rolled up data, the query service accesses the
kf_metrics_rolluptable for the minimum timestamps.If the query time range contains the minimum timestamp, the query service splits the query into multiple queries. The older data uses the
kf_metricstable, while newer data uses the rolled up tablekf_metrics_rollup. Query service then merges the responses before returning the result.