Skip to content

feat: adjust alert template title and body to reflect alert state - #1339

Merged
kodiakhq[bot] merged 4 commits into
mainfrom
warren/refine-resolved-alert-body-message
Nov 10, 2025
Merged

kodiakhq[bot] merged 4 commits into
mainfrom
warren/refine-resolved-alert-body-message

Conversation

@wrn14897

@wrn14897 wrn14897 commented Nov 10, 2025 •

Copy link
Copy Markdown
Contributor

Currently, the resolved alert will have the same title and body message as the alerting one, which is misleading

Ref: HDX-2786

Slack

ALERT

Screenshot 2025-11-09 at 10 02 52 PM

RESOLVED

Screenshot 2025-11-09 at 10 26 01 PM

incident.io

ALERT

Screenshot 2025-11-09 at 11 07 30 PM

RESOLVED

Screenshot 2025-11-09 at 11 08 56 PM

@changeset-bot

changeset-bot Bot commented Nov 10, 2025 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3e6ae6b

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

This PR includes changesets to release 2 packages
Name Type
@hyperdx/api Minor
@hyperdx/app Minor

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

@vercel

vercel Bot commented Nov 10, 2025 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
hyperdx-v2-oss-app Ready Ready Preview Comment Nov 10, 2025 6:28pm

@claude

claude Bot commented Nov 10, 2025 •

Copy link
Copy Markdown

PR Review: Alert Template State Awareness

✅ Overall assessment: Implementation is solid with good test coverage.

Critical Issues

None found.

Code Quality Observations

✅ Strengths:

  • Good separation of concerns with isAlertResolved() helper function (template.ts:86)
  • Comprehensive test coverage including edge cases for all alert states
  • Consistent emoji prefix logic (🚨 for alerts, ✅ for resolved)
  • Properly handles resolved alerts by skipping expensive ClickHouse queries (template.ts:543-545)

⚠️ Minor Observations:

1. Template body formatting inconsistency

  • Line 544: Resolved alert message has inconsistent formatting vs alert messages (lines 603, 617)
  • Resolved: Group: "xxx" - The alert... (note the dash)
  • Alert: Group: "xxx"\n... (newline, no dash)
  • Suggestion: Consider aligning format for consistency, though current approach is acceptable

2. Missing TILE source handling for resolved alerts

  • Resolved alerts only show simplified message regardless of source type (SAVED_SEARCH vs TILE)
  • This is likely intentional but worth confirming it matches product requirements
  • Test at line 663 only covers SAVED_SEARCH source

Test Coverage

✅ Excellent test coverage:

  • State-aware title generation (lines 233-280)
  • isAlertResolved() helper (lines 283-294)
  • Resolved alert rendering with simplified message (lines 663-718)
  • All existing tests updated to reflect emoji prefixes

Summary

No blocking issues. The implementation is production-ready. Minor formatting inconsistency noted but not critical.

@github-actions

github-actions Bot commented Nov 10, 2025 •

Copy link
Copy Markdown
Contributor

E2E Test Results

✅ All tests passed • 39 passed • 3 skipped • 288s

Status Count
✅ Passed 39
❌ Failed 0
⚠️ Flaky 0
⏭️ Skipped 3

View full report →

@pulpdrew pulpdrew 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.

LGTM

@kodiakhq
kodiakhq Bot merged commit 840d730 into main Nov 10, 2025
9 checks passed
@kodiakhq
kodiakhq Bot deleted the warren/refine-resolved-alert-body-message branch November 10, 2025 18:29
knudtty pushed a commit that referenced this pull request Apr 16, 2026
)

Currently, the resolved alert will have the same title and body message as the alerting one, which is misleading

Ref: HDX-2786

## Slack

### ALERT
<img width="723" height="358" alt="Screenshot 2025-11-09 at 10 02 52 PM" src="https://github.com/user-attachments/assets/b1c6f563-f095-457e-9a70-01c8149796c4" />

### RESOLVED
<img width="650" height="117" alt="Screenshot 2025-11-09 at 10 26 01 PM" src="https://github.com/user-attachments/assets/07ef1e7d-8ee5-4604-92cf-4811a0a5c811" />

## incident.io

### ALERT
<img width="1432" height="398" alt="Screenshot 2025-11-09 at 11 07 30 PM" src="https://github.com/user-attachments/assets/30e25eb3-32b2-4f51-934d-b28e75dd5cf7" />

### RESOLVED
<img width="1427" height="305" alt="Screenshot 2025-11-09 at 11 08 56 PM" src="https://github.com/user-attachments/assets/913a5b99-bb07-47ae-bec9-6b0814e4b400" />
kodiakhq Bot pushed a commit that referenced this pull request Nov 2, 2026
#3467)

## Summary

Closes #3466

I know #3466 hasn't been through feedback yet and CONTRIBUTING asks for `Accepting PR` first. I had already written and tested this before filing the issue, so I'm opening it now in case it helps the discussion. Happy to rework it or close it if you want a different direction.

Alert notification titles always start with 🚨 or ✅. That reads well in Slack, but a destination that already says firing or resolved, such as a webhook feeding an email relay, gets the emoji in its subject line with no way to remove it.

Following review, this is now a setting on the webhook rather than the alert: an optional boolean `titleEmoji`, where `false` drops the prefix for notifications sent to that webhook. Unset or `true` leaves titles unchanged. An alert that notifies several webhooks through `@webhook-` mentions gets the prefix per destination.

- The title is built once without the emoji, and the prefix is added per channel when the dispatch jobs are queued, unless that webhook opts out.
- The field follows `description` through the webhook model, the internal and v2 webhook APIs, `openapi.json` and the common-utils types.
- The webhook form has a "Show state emoji in notification titles" checkbox, checked by default.
- The MCP `saveWebhook` tool takes the field, since its update clears omitted settings.

### How to reproduce

**Starting point:** `yarn dev`, with two webhook destinations and a saved-search alert that notifies both (one as its channel, one through an `@webhook-` mention in the message).

**On `main`:**

1. Trigger the alert. Both notification titles start with 🚨, and no setting removes it.

**On this branch:**

1. In Team Settings, edit the first webhook and untick "Show state emoji in notification titles".
2. Trigger the alert. The first webhook's title has no prefix, the second keeps 🚨, and the resolved notifications follow the same split.
3. `GET /api/v2/webhooks` returns `"titleEmoji": false` for the first webhook.

`make dev-int FILE=checkAlerts` runs the two-webhook case.

### How to test on Vercel preview

Open Team Settings, edit or create a webhook, and check that the new checkbox saves and reloads.

### References

- Linear Issue:
- Related PRs: #1339

This branch was successfully deployed

1 active deployment
Preview — 3e6ae6b2 Deployed Nov 10, 2025 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants