Files
ottyl/tickets/039-metric-param-query-resolves-declared-params.md
T

1.3 KiB

039 — metric[param] query syntax should resolve against declared params

Summary

compile_metric_comparison (src/engine.rs) resolves the param in metric[param] <op> value by reading whatever key happens to be present in a bucket's labels map at query time. There's no link back to a metric's actual declared label params, so a typo or a param that was never a label on that metric fails silently (empty match) instead of being rejected up front.

Scope

  • Once 037 lands, validate metric[param] filter expressions against the target metric's declared label_params at parse/compile time.
  • Return a clear filter-validation error when param is not one of the metric's label params, instead of silently matching nothing.
  • Confirm src/filter_parser.rs and compile_metric_comparison share the same notion of "param" as the Params panel and metric declarations after this change (no separate resolution path).

Acceptance criteria

  • metric[nonexistent_param] == "x" is rejected with a validation error referencing the metric's actual label params, rather than silently returning no matches.
  • Existing valid filter queries using real label params continue to work unchanged.

Depends on

037.