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
This commit is contained in:
Pulse Monitor
2025-08-29 11:02:39 +00:00
parent e6c15f620a
commit bbf499cd10
2 changed files with 2 additions and 5 deletions
+1 -1
View File
@@ -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,
+1 -4
View File
@@ -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"
}
}]
}`,