Skip to content
This repository has been archived by the owner on Aug 31, 2022. It is now read-only.

feature: slack receiver should use webhook instead of token #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

taketo957
Copy link

#30

As slack is depreciating slack tokens, I modifiied slack receiver to use webhook instead of token.

Here is my config for test.

apiVersion: v1
kind: ConfigMap
metadata:
  name: event-exporter-cfg
  namespace: monitoring
data:
  config.yaml: |
    route:
      match:
        - receiver: "slack"
    receivers:
      - name: "slack"
        slack:
          endpoint: "https://hooks.slack.com/xxx"
          message: "{{ .Message }}"
          fields:
            namespace: "{{ .Namespace }}"
            reason: "{{ .Reason }}"

Below is the output.

スクリーンショット 2020-04-15 19 12 12

@mustafaakin
Copy link
Contributor

The channel was customizable, so we could redirect messages to users based on namespaces etc. Is this not possible anymore with the deprecation?

@taketo957
Copy link
Author

The channel was customizable, so we could redirect messages to users based on namespaces etc. Is this not possible anymore with the deprecation?

If we use webhook instead of token, the channel is configured when creating webhook (ref: https://api.slack.com/messaging/webhooks)

I investigated what #30 (comment) is talking about.
Probably we can use scoped token instead of legacy token. (ref: https://api.slack.com/authentication/token-types)

Should we support both token and webhook?

@mustafaakin
Copy link
Contributor

@taketo957 sorry for taking time to review this. The initial use case we hat at Opsgenie that each dev has their own namespace and we could direct the messages to them easily, but with the webhooks we would need to create a webhook per channel, right? Can we use the "Bot User Tokens" or Workspace tokens https://api.slack.com/authentication/token-types in that page? Or is that making things too complicated? Back then we could just generate a bot token easily, did that change also?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants