Add metric declaration storage and validation to engine index (ticket 002)
Adds IndexKey::MetricDeclaration handling: DeclareMetric/RemoveMetricDeclaration engine messages and a MetricDeclarations query, mirroring the pattern from ticket 001's param declarations. Params are derived from inline named capture groups on the metric's own regex for v1 (referencing existing ParamDeclarations is left for a future ticket). Validates the regex and every RegexToMetricPrimitiveMatcher's capture-group reference at declaration time, reporting all bad matchers at once. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XFUNZwCvz3kcod3352ZR2o
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
faca2af328
commit
d37c35772d
+8
-1
@@ -1,4 +1,4 @@
|
||||
use crate::data_value::MetricPrimitiveKind;
|
||||
use crate::data_value::{MetricPrimitiveKind, RegexToMetricPrimitiveMatcher};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Clone, Serialize)]
|
||||
@@ -16,6 +16,13 @@ pub struct ParamDeclarationDto {
|
||||
pub kind: MetricPrimitiveKind,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize)]
|
||||
pub struct MetricDeclarationDto {
|
||||
pub name: String,
|
||||
pub message_match_regex: String,
|
||||
pub params: Vec<RegexToMetricPrimitiveMatcher>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize)]
|
||||
pub struct TimelineBucketDto {
|
||||
pub start_ms: i64,
|
||||
|
||||
Reference in New Issue
Block a user