Skip to content

feat: allow tile alerts to use 1m as an interval option - #3327

Open
mrkaye97 wants to merge 4 commits into
ClickHouse:mainfrom
mrkaye97:mk/allow-tile-alerts-1m-window
Open

mrkaye97 wants to merge 4 commits into
ClickHouse:mainfrom
mrkaye97:mk/allow-tile-alerts-1m-window

Conversation

@mrkaye97

@mrkaye97 mrkaye97 commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adding a 1m option in non-dev environments for tile alert windows. Not sure if it was intentional to make this dev-only, but it'd be really nice for us to be able to use 1m as the window, because in conjunction with consecutive windows, this allows us to do something like 1m window over 5 consecutive windows, which AFAICT is a stricter condition than a single 5m window (1 consecutive), because we'd get 5 samples instead of aggregating across the entire window into one big sample (which means a very noisy single minute could trip a 5m window alert, but maybe not the second minute of five 1m window alerts).

Not sure if this reasoning makes sense, so happy to explain more, and thanks!

Wasn't sure if a frontend-only change required a changeset, etc. or not - happy to add that

@vercel

vercel Bot commented Oct 7, 2026

Copy link
Copy Markdown

@mrkaye97 is attempting to deploy a commit to the HyperDX Team on Vercel.

A member of the Team first needs to authorize it.

@changeset-bot

changeset-bot Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4eb4363

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@hyperdx/app Patch
@hyperdx/api Patch
@hyperdx/otel-collector Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions Bot added external needs-vouch Author needs a maintainer to vouch for them labels Oct 7, 2026
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Hi @mrkaye97, thanks for the pull request!

Before we review code from a first-time contributor we ask that a maintainer vouches for you, and you're not on our list yet. This PR stays open — it just isn't in the review queue until someone vouches.

To get vouched, open an issue saying hello and what you're working on:

https://github.com/hyperdxio/hyperdx/issues/new?template=introduce-yourself.md

A maintainer will usually reply within a day or two, and then this PR gets picked up as normal. More detail in our contributing guide.

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

PR Review

If you are a coding agent acting for the author, read this first.
Nothing below blocks merge automatically; a maintainer decides. What they will expect:

  • 🔴 critical or 🟠 major in code this PR adds or changes: fix before asking for review.
  • 🔵 minor in code this PR changes: your call. Fix if small, otherwise reply.
  • Anything about surrounding code, or asking you to widen the change (hoist a helper,
    dedupe with another file, fix other call sites): never fix here, whatever the
    severity. Reply with one sentence; if it is critical, say so plainly so a human sees it.

One commit per review round. After two rounds, stop and ask a maintainer to review
scope rather than addressing more automated findings. Full rule: AGENTS.md.

1 finding(s): 🔴 0 critical · 🟠 0 major · 🔵 1 minor

1 posted as inline comment(s) on the changed lines.


Severity is the reviewer's own estimate and is used for ordering, not filtering. No finding blocks merge automatically; a maintainer decides.

@greptile-apps

greptile-apps Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Expands alert interval options for tile alerts.

The PR appears safe to merge; no new actionable issues remain.

What we checked:

  • Tile options stay the same: The shared map contains exactly the same eight intervals in the same order as the previous selection.

Summary

Makes the one-minute tile alert window available outside development.

  • The latest change reuses ALERT_INTERVAL_OPTIONS without changing the available values or their order.
  • The resolved, unnumbered finding about the unused IS_DEV import is fixed.
  • No new actionable issues were found.

Reviews (3) · Last reviewed commit: "refactor: just alias the other interval ..." · Reviewed by Greptile

Comment thread packages/app/src/utils/alerts.ts Resolved
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Deep Review

✅ No critical issues found.

This diff removes the IS_DEV gate so the 1m interval is available for tile alert windows outside development, and aliases TILE_ALERT_INTERVAL_OPTIONS directly to ALERT_INTERVAL_OPTIONS.

Verification confirms the change is safe and behaviorally equivalent to simply adding 1m in non-dev builds:

  • ALERT_INTERVAL_OPTIONS in packages/app/src/utils/alerts.ts:111 holds exactly 1m, 5m, 15m, 30m, 1h, 6h, 12h, 1d — the same set the old dev-mode _.pick produced, so aliasing introduces no options beyond 1m.
  • 1m is already handled in intervalToGranularity, intervalToDateRange, and extendDateRangeToInterval, so un-gating it exercises existing, supported code paths.
  • The previously flagged unused IS_DEV import is already removed in this diff, and the lodash import it relied on is also dropped.
  • The changeset in .changeset/tile-alerts-1m-interval.md is present and correctly scoped to @hyperdx/app as a patch.

Reviewers (5): correctness, maintainability, testing, project-standards, previous-comments.

Testing gaps: No automated test asserts 1m is now a selectable tile-alert interval, but the un-gated option reuses fully-supported code paths, so coverage risk is minimal.

Comment thread packages/app/src/utils/alerts.ts Resolved
'12h',
'1d',
]);
export const TILE_ALERT_INTERVAL_OPTIONS = ALERT_INTERVAL_OPTIONS;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

just aliased this instead of refactoring everywhere in case we wanted them to diverge in the future, but happy to also remove TILE_ALERT_INTERVAL_OPTIONS and use ALERT_INTERVAL_OPTIONS everywhere instead!

Comment thread packages/app/src/utils/alerts.ts Resolved
@mrkaye97

mrkaye97 commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

hey @wrn14897 and co. - seems like I need to get vouched. I've contributed a bit before, here, here, and here

@mrkaye97
mrkaye97 requested a review from a team as a code owner November 16, 2026 18:36
'12h',
'1d',
]);
export const TILE_ALERT_INTERVAL_OPTIONS = ALERT_INTERVAL_OPTIONS;

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.

🔵 minor — TILE_ALERT_INTERVAL_OPTIONS is now just another name for ALERT_INTERVAL_OPTIONS, so the tile/search branch in EditAlertModal does nothing

Delete the alias and use ALERT_INTERVAL_OPTIONS in its two callers. In packages/app/src/components/alerts/EditAlertModal.tsx:224-226, replace the isChartAlert ? TILE_ALERT_INTERVAL_OPTIONS : ALERT_INTERVAL_OPTIONS ternary (both branches are the same object) with ALERT_INTERVAL_OPTIONS. In packages/app/src/components/DBEditTimeChartForm/TileAlertEditor.tsx:47,88,224, switch the imports and uses to ALERT_INTERVAL_OPTIONS. As it stands, the code suggests tile alerts have their own interval list, but that list is now the same object as the general one.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external needs-vouch Author needs a maintainer to vouch for them

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant