Skip to content

Improved Alertmanager Slack Bot support #7967

@stromnet

Description

@stromnet

Component(s)

AlertManagerConfig

What is missing? Please describe.

When configuring a Slack receiver, it can be configured to use a Bot token instead of a Webhook, by setting api_url to https://slack.com/api/chat.postMessage](https://api.slack.com/methods/chat.postMessage.

Generally I want all my receivers to use the same approach. And potentially also share the same token.

Two things that could simplify for me:

  • The AlertmanagerGlobalConfig obj has slackApiUrl, but this is a secretref. For the URL value, it's not really a secret and a plain-text (or just boolean?) value would be just fine.
  • For each receiver defined (and it can be quite a lot, one per team & ns & app and whatnot), I need to provide
httpConfig:
  bearerTokenSecret:
    name: slack-bot-token
    key: slack-bot-token

Instead, it would be nice if I could just have slackHttpConfig or similar in AlertmanagerGlobalConfig to define it once (it would be a operator-specific construct, there is no "slack_http_config" in regular config).

Also, the operator renders this to http_config: {bearer_token: actualsecretvalue }. It could instead of exposing the secret in plain text, just mount that secret on the pod, and use authorization: {credentials_file: xxx} syntax in config file.

Describe alternatives you've considered.

No response

Environment Information.

Environment

Kubernetes Version:
Prometheus-Operator Version:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions