Skip to content

Add metric alert daily rollup#8235

Merged
jonathanawesome merged 9 commits into
mainfrom
metric-alert-daily-rollup
Jul 20, 2026
Merged

Add metric alert daily rollup#8235
jonathanawesome merged 9 commits into
mainfrom
metric-alert-daily-rollup

Conversation

@jonathanawesome

Copy link
Copy Markdown
Member

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_DAY constant 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.

@github-actions

github-actions Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
hive 11.7.0-alpha-20260720131316-b260f3ff32a84b5aa2cded6162a236f9cd9d017c npm ↗︎ unpkg ↗︎

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions

github-actions Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

🐋 This PR was built and pushed to the following Docker images:

Targets: build

Platforms: linux/amd64

Image Tags: 11.7.0-alpha-b260f3f, b260f3f, b260f3ff32a84b5aa2cded6162a236f9cd9d017c

@jonathanawesome
jonathanawesome merged commit 91f971f into main Jul 20, 2026
25 checks passed
@jonathanawesome
jonathanawesome deleted the metric-alert-daily-rollup branch July 20, 2026 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants