Skip to content

Conversation

@mihir-dixit2k27
Copy link
Contributor

Closes #3071

Changes:

  • Added message field to SlackConfig.
  • Mapped this field to the top-level text field in the Slack JSON payload.
  • Added unit tests to verify the payload structure.

Reasoning:
This allows users to send simple text messages compatible with Slack Workflow Webhooks, which cannot parse attachments.

…ons (prometheus#3071)

Signed-off-by: mihir-dixit2k27 <mihidixi@gmail.com>
Signed-off-by: mihir-dixit2k27 <mihidixi@gmail.com>
@mihir-dixit2k27 mihir-dixit2k27 force-pushed the feat-slack-text-field branch 9 times, most recently from 9f1f2ab to 95dc178 Compare January 6, 2026 20:19
Signed-off-by: mihir-dixit2k27 <mihidixi@gmail.com>
go.sum Outdated
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/log v0.1.0 h1:DGJh0Sm43HbOeYDNnVZFl8BvcYVvjD5bqYJvp0REbwQ=
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these changes to go.mod unrelated?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are absolutely correct—those changes were unintended updates caused by my local environment. I have reverted go.mod and go.sum to match main, so this PR now remains focused purely on the new feature

Signed-off-by: Mihir Dixit <dixitmihir1@gmail.com>
Copy link
Contributor

@ultrotter ultrotter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides the go.mod changes in the diff, LGTM. Can you remove that please?

Signed-off-by: Mihir Dixit <dixitmihir1@gmail.com>
Copy link
Contributor

@Spaceman1701 Spaceman1701 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does the resulting slack message look like when both text and message are set?

Copy link
Contributor

@Spaceman1701 Spaceman1701 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking the time to make those changes!

Signed-off-by: Mihir Dixit <dixitmihir1@gmail.com>
@SuperQ
Copy link
Member

SuperQ commented Jan 21, 2026

Files need go fmt.

Signed-off-by: Mihir Dixit <dixitmihir1@gmail.com>
Signed-off-by: mihir-dixit2k27 <143348248+mihir-dixit2k27@users.noreply.github.com>
@mihir-dixit2k27
Copy link
Contributor Author

@SuperQ ready for re review

@SuperQ SuperQ merged commit 1946357 into prometheus:main Jan 30, 2026
7 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.

Feature request: Allow top level text field in Slack notifications

4 participants