From bbf499cd109e8e6cbd06e0887de060342bca50bb Mon Sep 17 00:00:00 2001 From: Pulse Monitor Date: Fri, 29 Aug 2025 11:02:39 +0000 Subject: [PATCH] fix: address Discord webhook issues from #378 - Remove invalid url field from Discord embed (was causing 400 error) - Remove SVG avatar/footer icons (Discord doesn't support SVG) - Fix test webhook to use proper instance URL instead of 'pulse-monitoring' - Discord webhook template now sends valid payloads --- internal/notifications/notifications.go | 2 +- internal/notifications/webhook_templates.go | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/internal/notifications/notifications.go b/internal/notifications/notifications.go index 4b1047533..031892767 100644 --- a/internal/notifications/notifications.go +++ b/internal/notifications/notifications.go @@ -1125,7 +1125,7 @@ func (n *NotificationManager) SendTestWebhook(webhook WebhookConfig) error { ResourceID: "webhook-test", ResourceName: "Test Alert", Node: "test-node", - Instance: "pulse-monitoring", + Instance: "http://your-pulse-instance:7655", // Placeholder URL for test webhooks Message: fmt.Sprintf("This is a test alert from Pulse to verify your %s webhook is working correctly", webhook.Name), Value: 85.5, Threshold: 80.0, diff --git a/internal/notifications/webhook_templates.go b/internal/notifications/webhook_templates.go index b418ad786..51dfdd4dd 100644 --- a/internal/notifications/webhook_templates.go +++ b/internal/notifications/webhook_templates.go @@ -22,11 +22,9 @@ func GetWebhookTemplates() []WebhookTemplate { Headers: map[string]string{"Content-Type": "application/json"}, PayloadTemplate: `{ "username": "Pulse Monitoring", - "avatar_url": "https://raw.githubusercontent.com/rcourtman/Pulse/main/frontend-modern/public/logo.svg", "embeds": [{ "title": "Pulse Alert: {{.Level | title}}", "description": "{{.Message}}", - "url": "{{.Instance}}", "color": {{if eq .Level "critical"}}15158332{{else if eq .Level "warning"}}15105570{{else}}3447003{{end}}, "fields": [ {"name": "Resource", "value": "{{.ResourceName}}", "inline": true}, @@ -38,8 +36,7 @@ func GetWebhookTemplates() []WebhookTemplate { ], "timestamp": "{{.Timestamp}}", "footer": { - "text": "Pulse Monitoring", - "icon_url": "https://raw.githubusercontent.com/rcourtman/Pulse/main/frontend-modern/public/logo.svg" + "text": "Pulse Monitoring" } }] }`,