Feature

PromQL

AST rewrite for multi-tenancy, autocomplete, lint, function hints.

Every user PromQL query is parsed and walked through the AST. On each VectorSelector and MatrixSelector the label matchers are replaced with a merged set where organization_id (and filters from the embed claim) always win. The tenant boundary rests on the AST, not on text regexes. The editor shows metric + builtin autocomplete and function signature hints.

Key properties

  • AST rewrite — organization_id cannot be bypassed even when stated explicitly
  • Live lint via /api/v1/promql/validate
  • Autocomplete: org metrics + builtin functions/aggregations
  • Function arg hints (rate(v range-vector) → instant-vector)
  • Lightweight regex tokenizer with highlighting — no heavy editor bundles

Related features