1.6 KiB
Support a boolean param kind that's always present (true/false, not omitted)
Discovered while scoping the "IsError" docs use case (see ticket 019): declaring a param today always requires a capture group, and a param is omitted from a line's fields (not false/empty) whenever its regex doesn't match (src/engine.rs, LogEntryDto::params build path — "A param is omitted (not included as null/empty) when its regex/capture group doesn't match"). There's also no boolean kind — MetricPrimitiveKind (src/data_value.rs) only has String, Number, Timestamp, Duration.
This blocks a use case like declaring a param IsError that's true for any message matching error (case-insensitively) and false for every other message — today a non-matching line just doesn't get the param at all, and there's no boolean type to hold the result even if it did.
Acceptance criteria
MetricPrimitiveKindgains aBooleanvariant (src/data_value.rs), serialized as"boolean"consistent with the other lowercase kinds.- A param declared with kind
Booleandoesn't require (or use) a capture group for its value — its value is whethermessage_match_regexmatches the line, case-insensitively or per the regex's own flags. - A
Boolean-kind param is present on every line astrueorfalse(never omitted), unlike capture-based params. - Params UI (
Params.tsx) offersbooleanas a kind option and hides/disables the capture-group input when it's selected (or clarifies it's unused). - Existing string/number/timestamp/duration param behavior (including the "omitted when unmatched" semantics for those) is unchanged.