Skip to content

Add configurable Google Chat and custom webhooks#4484

Open
ameyap94 wants to merge 1 commit intotarget:masterfrom
ameyap94:google-chat-webhook-notifications
Open

Add configurable Google Chat and custom webhooks#4484
ameyap94 wants to merge 1 commit intotarget:masterfrom
ameyap94:google-chat-webhook-notifications

Conversation

@ameyap94
Copy link
Copy Markdown

@ameyap94 ameyap94 commented May 4, 2026

Description:
Google Chat incoming webhooks do not accept GoAlert’s generic webhook payload directly. Google Chat expects a Chat message payload, so sending GoAlert’s JSON as-is results in a payload shape mismatch.

This PR adds:

  • native Google Chat notification support that formats messages into the {"text":"..."} payload Google Chat expects
  • a separate Custom Webhook destination with templated request bodies
  • config gates for both destinations so they can be enabled independently of the existing generic webhook contact method

The existing generic webhook contact method continues to use Webhook.Enable.

Custom Webhook examples:

Simple summary text:

{"text":"{{.Summary}}"}

Service alert count:

{"text":"{{.ServiceName}} has {{.Count}} unacknowledged alerts"}

On-call change:

{"text":"{{.ScheduleName}} on-call: {{range .Users}}{{.Name}} {{end}}"}

The template context also exposes fields such as: MessageID, AppName, Type, AlertID, Details, ServiceID, ServiceName, Count, LogEntry, Code, ScheduleID, ScheduleName, ScheduleURL, NewAlertState, Users, and Meta.

Which issue(s) this PR fixes:
None

Screenshots:

Admin configuration
Admin configuration showing Google Chat and Custom Webhook enabled

Google Chat Escalation step setup
Escalation step setup
Escalation steps showing Google Chat destination chip
Escalation steps showing Google Chat destination chip
Notification rule with Google Chat
Notification rule with Google Chat
Notification rule showing Google Chat destination chip
Escalation steps showing Google Chat destination chip

Custom Webhook notification setup
Destination type menu showing Custom Webhook and Google Chat

Message previews
Escalation
Google chat message preview1
Notification rule
Google chat message preview2

Describe any introduced user-facing changes:

  • Google Chat and Custom Webhook destinations now appear only when their respective config flags are enabled
  • Google Chat notifications are sent using a Chat-compatible JSON payload
  • Custom Webhook supports templated bodies and optional content type

Describe any introduced API changes:

  • Added public config keys:
    • GoogleChat.Enable
    • CustomWebhook.Enable

Additional Info:
Verified with:

  • go test ./config ./graphql2 ./notification/webhook ./notification/googlechat ./app -count=1
  • node_modules/.bin/tsc -p web/src/app/tsconfig.json --noEmit

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant