Add param declaration storage and validation to engine index

Implements the ParamDeclaration slice of the primary index: DataValue::ParamDeclaration
holds a regex + named capture group + MetricPrimitiveKind, stored under
IndexKey::ParamDeclaration{name} between LogParamSplit and ParamMetricSplit.
EngineMessage gains DeclareParam (validates the regex compiles and the capture
group exists before storing, returning a clear error otherwise) and
RemoveParamDeclaration; EngineQuery gains ParamDeclarations to list them back out
as ParamDeclarationDto. No API wiring yet (separate ticket).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XFUNZwCvz3kcod3352ZR2o
This commit is contained in:
Hugh Kaznowski
2026-09-05 12:42:38 +01:00
co-authored by Claude Sonnet 5
parent 1fb564d06b
commit f62830d8f7
5 changed files with 219 additions and 2 deletions
+9
View File
@@ -1,3 +1,4 @@
use crate::data_value::MetricPrimitiveKind;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize)]
@@ -7,6 +8,14 @@ pub struct LogEntryDto {
pub text: String,
}
#[derive(Debug, Clone, Serialize)]
pub struct ParamDeclarationDto {
pub name: String,
pub message_match_regex: String,
pub capture_group: String,
pub kind: MetricPrimitiveKind,
}
#[derive(Debug, Clone, Serialize)]
pub struct TimelineBucketDto {
pub start_ms: i64,