Skip to main content

validate_aggregate_widgets

Function validate_aggregate_widgets 

Source
pub fn validate_aggregate_widgets(
    widgets: &[AggregateWidget],
    field: &str,
) -> Result<(), String>
Expand description

Per-widget validation for a list of AggregateWidgets — shared by the aggregate: job hint (Manifest::validate) and the standalone View resource (#743) so the two can’t diverge. field names the containing key for error messages ("aggregate" or "widgets").

Enforces: non-empty list; non-empty dashboard/title (and kind/agg for every aggregation render); a blank-when-set source; rejection of any #492 Unknown enum (an operator typo at create time); safe dotted JSON paths; the value path each agg needs (and rejection of mis-paired ones); pc_id grouping only in fleet scope; transform/limit/ exclude only with a group_by; positive limit/sample_minutes; gaugeratio; and timelinetime_bucket. A render: op_timeline widget is validated separately (per-PC, no aggregation knobs) — see [validate_op_timeline_widget].