Skip to content

Message too long for Discord #194

Closed
Closed

Description

@zackchadwick

Describe the bug
Discord webhooks have a 1024 character limit for the value field. The current implementation exceeds this causing notifications to Discord to fail.

Messages sent to Discord need to be split into multiple 1024-character messages.

Reference:
https://birdie0.github.io/discord-webhooks-guide/other/field_limits.html
https://discord.com/developers/docs/resources/channel#embed-object-embed-field-structure

To Reproduce
Cause a CrashLoopBackOff on a pod that is within the monitoring scope of kwatch.

Expected behavior
A notification successfully sent to Discord via the configured webhook.

Actual behavior
Error is logged within kwatch in regards to a failed notification due to exceeding the 1024 character limit.

level=error msg="failed to send event with Discord: HTTP 400 Bad Request, {\"code\": 50035, \"errors\": {\"embeds\": {\"0\": {\"fields\": {\"6\": {\"value\": {\"_errors\": [{\"code\": \"BASE_TYPE_MAX_LENGTH\", \"message\": \"Must be 1024 or fewer in length.\"}]}}}}}}, \"message\": \"Invalid Form Body\"}"

Version/Commit
0.8.0

Activity

  1. Zenteno commented on Jun 7, 2023

    @Zenteno

    This problem also happens on telegram

    time="2023-06-06T22:40:42Z" level=error msg="failed to send event with Telegram: call to telegram alert returned status code 413"
    
    
  2. dunglavmo commented on Oct 13, 2023

    @dunglavmo

    same issue!

  3. willyfransca commented on Sep 17, 2024

    @willyfransca

    you manual update the code for limit the character to 1000 character
    path: alertmanager/discord/discord.go
    the souce code like this
    image

    this worked for me
    thank

  4. abahmed commented on Sep 6, 2026

    @abahmed
    Owner

    Fixed in main, but not released yet. Discord event and log content is split into Discord-safe 1024-character embed fields and capped to the provider field limit. The fix will be available in the next release.

  5. abahmed commented on Oct 19, 2026

    @abahmed
    Owner

    🎉 This is now released in kwatch v1.0.0: https://github.com/abahmed/kwatch/releases/tag/v1.0.0

    Upgrade with the installer:

    /bin/bash -c "$(curl -fsSL https://kwatch.dev/kwatch.sh)"

    Coming from 0.10.x? Check the upgrade notes in the release first. Feedback is welcome in #564 🙏

  6. added this to the v1.0.0 milestone on Oct 19, 2026
  7. moved this to ✅ Done in kwatchon Oct 19, 2026
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

    No labels
    No labels

    Type

    No type

    Projects

    • Status
      ✅ Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions