Skip to content

{{note}} renders empty in webhook bodies when an alert fires #3644

Closed

Description

@andrewdunndev

What happened?

{{note}} is empty in Generic and incident.io webhook bodies when an alert fires, even when the alert has a note. "Send test" does show a note, so the template looks right until a real alert fires.

The path, at current main:

  • fireChannelEvent builds the template view's alert as an object literal, and note is not one of its fields (checkAlerts/index.ts#L538-L565).
  • renderAlertTemplate reads note: alert.note ?? '' from that view, so it is always '' (template.ts#L770).
  • The Generic transport writes message.note into {{note}} (generic.ts#L105).
  • The test webhook builds its message with a hard-coded note, so it never takes this path (webhooks.ts#L517).

I found this reading the source and haven't triggered it on a running instance.

Steps to reproduce

Reproduces on play.hyperdx.io? didn't try

From the code above, this should show it:

  1. Create an alert with a note, on a Generic webhook whose body includes {"note": "{{note}}"}.
  2. Click "Send test": the receiver gets the sample note.
  3. Let the alert fire: the receiver gets "note": "".

How are you running HyperDX?

Self-hosted app image with our own ClickHouse and the standalone collector. The code above is current main.

Where does it show up?

The API: webhook delivery from the alert worker.

Debug info

N/A, not a UI bug.

Logs

N/A.

The fix looks like one line, note: alert.note, in that literal, plus a test that renders {{note}} through the worker path. I'd be glad to send it if this is marked Accepting PR.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions