Skip to content

Fix Lite long-running query alerts firing on stale DuckDB snapshots#783

Merged
erikdarlingdata merged 1 commit intodevfrom
fix/lite-stale-snapshot-alerts
Apr 2, 2026
Merged

Fix Lite long-running query alerts firing on stale DuckDB snapshots#783
erikdarlingdata merged 1 commit intodevfrom
fix/lite-stale-snapshot-alerts

Conversation

@erikdarlingdata
Copy link
Copy Markdown
Owner

Summary

  • Lite's long-running query alert reads from v_query_snapshots (DuckDB) using MAX(collection_time) to find the latest snapshot
  • When the collector captures 0 active queries, no new rows are inserted, so MAX(collection_time) still returns the old snapshot — alerts re-fire indefinitely on queries that finished hours ago
  • Added a 10-minute recency check so stale snapshots are ignored

Test plan

  • Confirmed alerts were firing every 5 minutes on a session that no longer existed
  • After fix, alerts stopped immediately
  • Verified collector is running and writing fresh snapshots

🤖 Generated with Claude Code

The alert query reads from v_query_snapshots using MAX(collection_time)
to find the latest snapshot. When the collector captures 0 active queries,
no new rows are inserted, so MAX(collection_time) still returns the old
snapshot — causing alerts to re-fire indefinitely on queries that finished
hours ago.

Add a 10-minute recency check so stale snapshots are ignored.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@erikdarlingdata erikdarlingdata merged commit 49af520 into dev Apr 2, 2026
3 checks passed
@erikdarlingdata erikdarlingdata deleted the fix/lite-stale-snapshot-alerts branch April 9, 2026 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant