Skip to content

fix: omit empty text field in Mattermost notifications#4985

Merged
siavashs merged 1 commit intoprometheus:mainfrom
slashpai:mattermost-text-fix
Feb 10, 2026
Merged

fix: omit empty text field in Mattermost notifications#4985
siavashs merged 1 commit intoprometheus:mainfrom
slashpai:mattermost-text-fix

Conversation

@slashpai
Copy link
Contributor

@slashpai slashpai commented Feb 9, 2026

Add omitempty tag to Text field to prevent sending empty text values to Mattermost, which causes 400 errors. Per the Mattermost API spec, text is only required if attachments are not set.

Related to prometheus-operator/prometheus-operator#8363

Add omitempty tag to Text field to prevent sending empty text values
to Mattermost, which causes 400 errors. Per the Mattermost API spec,
text is only required if attachments are not set.

Related to prometheus-operator/prometheus-operator#8363

Signed-off-by: Jayapriya Pai <janantha@redhat.com>
@TheMeier
Copy link
Contributor

TheMeier commented Feb 9, 2026

LGTM. Although with the default template, the text field is never empty. So one could argue (which I am not) it is working as designed and users must ensure that custom templates in mattermost_config.text must not produce empty strings.

@siavashs siavashs merged commit b4203e8 into prometheus:main Feb 10, 2026
11 of 12 checks passed
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.

3 participants