Skip to content

alertmanager: add Slack app token support to AlertmanagerConfig CRD#8243

Open
pharaujo wants to merge 12 commits intoprometheus-operator:mainfrom
pharaujo:alertmanager-0.30.0-slack_app
Open

alertmanager: add Slack app token support to AlertmanagerConfig CRD#8243
pharaujo wants to merge 12 commits intoprometheus-operator:mainfrom
pharaujo:alertmanager-0.30.0-slack_app

Conversation

@pharaujo
Copy link

@pharaujo pharaujo commented Jan 6, 2026

Description

Slack app support released in alertmanager v0.30.0, (implemented in prometheus/alertmanager#4211).

Supporting the new fields in the Alertmanager config was done in #8238, and now this one adds support for them in the operator CRs.

Additionally added SlackConfig tests I had around.

Closes #7967

Type of change

What type of changes does your code introduce to the Prometheus operator? Put an x in the box that apply.

  • CHANGE (fix or feature that would cause existing functionality to not work as expected)
  • FEATURE (non-breaking change which adds functionality)
  • BUGFIX (non-breaking change which fixes an issue)
  • ENHANCEMENT (non-breaking change which improves existing functionality)
  • NONE (if none of the other choices apply. Example, tooling, build system, CI, docs, etc.)

Verification

Added tests to validate functionality. Additionally, my company has been running a prometheus-operator fork with this patch since last February (original patch here: 8fd1df7)

Changelog entry

- Add support for configuring Slack app tokens in Alertmanager through the operator CRs

@pharaujo pharaujo requested a review from a team as a code owner January 6, 2026 14:45
@pharaujo pharaujo force-pushed the alertmanager-0.30.0-slack_app branch 3 times, most recently from 27122bb to 50d0572 Compare January 6, 2026 15:29
Copy link
Contributor

@simonpasquier simonpasquier 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 the PR! Can you split the change into 2 PRs? The first one would be the support in pkg/alertmanager/types.go and the second one the changes to the AlertmanagerConfig CRDs. It makes it easier to review.

@heliapb
Copy link
Member

heliapb commented Jan 6, 2026

Thanks for the PR! Can you split the change into 2 PRs? The first one would be the support in pkg/alertmanager/types.go and the second one the changes to the AlertmanagerConfig CRDs. It makes it easier to review.

@simonpasquier I had opened the one already for the am config, maybe this can cover the crd changes #8238. /cc @pharaujo

@pharaujo
Copy link
Author

pharaujo commented Jan 7, 2026

Sure, I'll rebase, thanks for the heads up!

@pharaujo pharaujo force-pushed the alertmanager-0.30.0-slack_app branch 4 times, most recently from eea3cd1 to 400e11b Compare January 7, 2026 14:22
Slack app support released in alertmanager
[v0.30.0](https://github.com/prometheus/alertmanager/releases/tag/v0.30.0),
(implemented in prometheus/alertmanager#4211).

Supporting the new fields in the Alertmanager config was done in prometheus-operator#8238,
and now this one adds support for them in the operator CRs.

Additionally added SlackConfig tests I had around.

Signed-off-by: Pedro Araujo <pedro.araujo@teya.com>
@pharaujo pharaujo force-pushed the alertmanager-0.30.0-slack_app branch from 400e11b to 4e77425 Compare January 7, 2026 14:32
@pharaujo
Copy link
Author

pharaujo commented Jan 7, 2026

@simonpasquier I've rebased, so now the PR is focused on the CRs.

@pharaujo pharaujo force-pushed the alertmanager-0.30.0-slack_app branch 3 times, most recently from 1d5f74b to c934d91 Compare January 8, 2026 14:11
Signed-off-by: Pedro Araujo <pedro.araujo@teya.com>
@pharaujo pharaujo force-pushed the alertmanager-0.30.0-slack_app branch from c934d91 to 685b7a2 Compare January 8, 2026 14:38
@simonpasquier simonpasquier changed the title alertmanager: add Slack app token support alertmanager: add Slack app token support to AlertmanagerConfig CRD Jan 13, 2026
Signed-off-by: Pedro Araujo <pedro.araujo@teya.com>
Signed-off-by: Pedro Araujo <pedro.araujo@teya.com>
Signed-off-by: Pedro Araujo <pedro.araujo@teya.com>
@pharaujo
Copy link
Author

@heliapb are you able to take another look? Thanks!

@pharaujo
Copy link
Author

@simonpasquier are you able to have a look, please?

@pharaujo pharaujo force-pushed the alertmanager-0.30.0-slack_app branch from 912d251 to 082bc3c Compare January 29, 2026 15:16
@pharaujo
Copy link
Author

@simonpasquier @heliapb am I missing anything else? Can I make any change to make reviewing easier? I feel the XL tag is misleading, as most code in the PR is generated; the core change is actually quite small.

// slackAppUrl defines the default URL for Slack App message posting API.
// It requires Alertmanager >= v0.30.0.
// +optional
SlackAppURL *URL `json:"slackAppUrl,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
SlackAppURL *URL `json:"slackAppUrl,omitempty"`
SlackAppURL *URL `json:"slackAppURL,omitempty"`

Copy link
Author

Choose a reason for hiding this comment

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

I understand what you're saying, the SlackConfig is appURL so it's inconsistent. I noticed it as well, but the other URLs in GlobalConfig are slackApiUrl, opsGenieApiUrl, pagerdutyUrl, so I thought it would make sense to keep consistency within the config scope. Do you still want me to change this?

Copy link
Contributor

Choose a reason for hiding this comment

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

@pharaujo Last time when I did the same (try to align with the former approach), the maintainers prefer to go with the newer approach when implementing new variables, although it is not aligned with the previous variables.

Let's wait for @simonpasquier to give a guidance. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improved Alertmanager Slack Bot support

4 participants