Add metric alert daily rollup#8235
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a daily rollup table (operations_by_target_daily) and materialized view in ClickHouse to optimize long-window metric alert evaluations (>= 7 days). It updates the workflows service deployment to depend on database migrations, enforces that long-window alert rules must be configured in whole-day increments, and adapts the metric alert evaluator to query the daily rollup table (except for traffic-based rules, which remain on hourly rollups to maintain precision). I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
🐋 This PR was built and pushed to the following Docker images: Targets: Platforms: Image Tags: |
This PR is the final PR in a sequence of PRs focused on optimizing the metric alerts feature. It routes metric alerts with windows of 7+ days to a new daily ClickHouse rollup instead of the hourly table, so a 30-day query reads ~60 daily buckets instead of ~1,440.
TRAFFIC-count rules stay on hourly (daily buckets would skew an absolute count by up to a full edge day), and the resolved tier is folded into the group key so a co-located latency rule still gets the daily win.
The API rejects 7+ day windows that aren't whole days (sharing a
MINUTES_PER_DAYconstant with the routing threshold), and the workflows service now deploys after DB migrations so the table exists before the route ships.The materialized view isn't backfilled, so long-window rules read partial history for up to ~30 days while it fills.