You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(examples): anchor the incident-investigation dataset to a fixed date (default 2026-06-18) (#80)
Follow-up to #65 (merged). The incident demo stack anchored its telemetry to wall-clock now (never-expiring but non-deterministic). For a reproducible RCA dataset the timestamps should be fixed, so the incident now anchors to a fixed instant by default: DEMO_ANCHOR (default 2026-06-18T02:17Z) anchors entities, logs, and the Prometheus backfill to the same instant — config ~anchor-24h, deploy ~anchor-12h, promotion ~anchor-4h, incident ~anchor — so every run produces the same ground-truth times.
DEMO_ANCHOR=now restores the wall-clock / never-expiring behaviour. The live exporter still serves the current breach so an instant get_metrics works on any day; verify.sh resolves the same anchor for its range queries. Scoped to examples/incident-investigation/deploy/ (generators + entrypoint + compose + scripts); no server/query changes.
Copy file name to clipboardExpand all lines: examples/incident-investigation/deploy/start.sh
+6-1Lines changed: 6 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -61,7 +61,12 @@ echo "==> Bringing up the incident-investigation demo stack with: $COMPOSE"
61
61
$COMPOSE -f "$COMPOSE_FILE" up -d --build
62
62
63
63
echo"==> Waiting for the 72h metric backfill + Elasticsearch seed + Prometheus scrapes (up to ~5 min)..."
64
-
hist_ts=$(( $(date +%s) -216000))# 60h ago: confirms the history was backfilled
64
+
# Probe the backfill 60h before the incident anchor (fixed date by default, or wall-clock when
65
+
# DEMO_ANCHOR=now), so the check lands inside the seeded window regardless of the current date.
66
+
anchor_ts=$(python3 -c 'import os,time,datetime as d
67
+
a=os.environ.get("DEMO_ANCHOR") or "2026-06-18T02:17:00Z"
68
+
print(int(time.time()) if a=="now" else int(d.datetime.strptime(a,"%Y-%m-%dT%H:%M:%SZ").replace(tzinfo=d.timezone.utc).timestamp()))'2>/dev/null || date +%s)
69
+
hist_ts=$(( anchor_ts -216000))# 60h before the anchor: confirms the history was backfilled
65
70
# Sentinel query: confirms localhost:$UMODEL_PORT is THIS demo (returns the degraded payment
66
71
# path), not some other umodel. A quoted heredoc keeps the SPL single quotes literal, no escaping.
# Anchor for the section-5 arc queries: the fixed incident instant by default (must match the
18
+
# seeded data), or wall-clock when DEMO_ANCHOR=now. Python keeps the ISO->epoch parse portable.
19
+
NOW=$(python3 -c 'import os,time,datetime as d
20
+
a=os.environ.get("DEMO_ANCHOR") or "2026-06-18T02:17:00Z"
21
+
print(int(time.time()) if a=="now" else int(d.datetime.strptime(a,"%Y-%m-%dT%H:%M:%SZ").replace(tzinfo=d.timezone.utc).timestamp()))'2>/dev/null || date +%s)
0 commit comments