Skip to content

Commit 14fe043

Browse files
zzylolclaude
andcommitted
Put the method in event text; explain novelty check failures
Loki keeps one entry per stream, timestamp and line, so a sketch and an exact event with the same text (identical top-k counts) collapsed into whichever arrived first; on the CI runner that dropped the sketch's novelty event. Each event line now starts with [sketch] or [exact]. The acceptance novelty check reports event counts and the asap_topk_new gauge when it fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AENeuitPyaE3fBYGTyP2HV
1 parent 73abb29 commit 14fe043

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

‎asap-precompute-rs/src/otap/answer_nodes.rs‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,10 @@ fn events_pdata(events: &[Event]) -> Result<OtapPdata, String> {
232232
.observed_time_unix_nano(e.window_end_ms * 1_000_000)
233233
.severity_number(SeverityNumber::Info)
234234
.severity_text("INFO")
235-
.body(AnyValue::new_string(e.body.clone()))
235+
// The method is part of the line: Loki drops a second entry with
236+
// the same stream, timestamp and line, and sketch and exact events
237+
// can otherwise read the same.
238+
.body(AnyValue::new_string(format!("[{}] {}", e.method, e.body)))
236239
.attributes(attributes)
237240
.finish()
238241
})

‎deploy/telemetry-functions/acceptance.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,11 @@ def topk_checks(stack, t):
186186
recall = len(top["sketch"] & top["exact"]) / max(1, len(top["exact"]))
187187
yield check("sketch top-10 recall vs exact >= 0.9", recall >= 0.9, f"recall {recall:.2f}")
188188
events = stack.events('| event_kind="novelty" | method="sketch"')
189+
flagged = stack.vector('max_over_time(asap_topk_new{key="/new/hot-route"}[10m])')
189190
yield check("novelty event in Loki", any("/new/hot-route" in e for e in events),
190-
next((e for e in events if "/new/hot-route" in e), "none"))
191+
next((e for e in events if "/new/hot-route" in e),
192+
f"none; {len(events)} sketch novelty events, "
193+
f"asap_topk_new gauge from {sorted(m['method'] for m, _ in flagged)}"))
191194

192195

193196
CASES = {

0 commit comments

Comments
 (0)