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

slack receiver should use webhook instead of token #30

Open
aavileli opened this issue Mar 19, 2020 · 6 comments
Open

slack receiver should use webhook instead of token #30

aavileli opened this issue Mar 19, 2020 · 6 comments
Labels
good first issue Good for newcomers

Comments

@aavileli
Copy link

aavileli commented Mar 19, 2020

slack is depreciating slack tokens

@mustafaakin mustafaakin added the good first issue Good for newcomers label Apr 10, 2020
@mustafaakin
Copy link
Contributor

Then it's a very good first issue to contribute.

@wcarlsen
Copy link

I think the webhook sink is covering this use case, considering incoming webhooks in Slack (https://api.slack.com/messaging/webhooks). I tested it and it works flawless. Of course you need to play with the layout, but I think one can live with this.
Maybe consider deprecating the Slack sink and recommend the webhook sink instead, since Slack recommends not using legacy tokens?

@minac
Copy link

minac commented Jul 17, 2020

Hey @wcarlsen! I could use a hand, how did you configure the Slack webhook?

receivers:
      - name: "slack"
        webhook:
          endpoint: "https://hooks.slack.com/services/bla/bla/bla"
          headers:
            User-Agent: kube-event-exporter 1.0

Did you use any API Token? When setting up Incoming Webhooks in Slack there are no tokens now, right?

Thanks!

@wcarlsen
Copy link

wcarlsen commented Jul 18, 2020

@minac if I recall it right, I was just adding an incoming webhook like you probably already did. My config.yaml was probably very similar to this:

logLevel: debug
route:
  # Main route
  routes:
    # This route allows dumping all events because it has no fields to match and no drop rules.
    - match:
        - receiver: "alert"
receivers:
  - name: "alert"
    webhook:
      endpoint: "https://hooks.slack.com/services/bla/bla/bla"
      layout:
        text: "{{.Message}}"

Hope it helped. You have to play around with the layout a bit to make it nice. But styling is probably a personal thing. Good luck!

@minac
Copy link

minac commented Jul 20, 2020

I was missing that last bit of the layout. Thank you!

@mrsiejas
Copy link
Contributor

Thanks @wcarlsen, this should be added to the docs. Also wasted few hours to realise I missed the layout section.

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

No branches or pull requests

5 participants