Yuval
Yuval

Reputation: 834

Can't see Grafana images in Slack

I set up a Slack notification channel in Grafana using a webhook as URL. When I click "Send Test" I see this notification in my Slack channel: enter image description here

However ordinary notifications are shown without images. I read Grafana's docs, but apparently I haven't understood it.

If you want to include screenshots of the firing alerts in the slack messages you have to configure either the external image destination in Grafana, or a bot integration via Slack Apps. Follow Slack’s guide to set up a bot integration and use the token provided https://api.slack.com/bot-users, which starts with “xoxb”.

Can someone guide me through it? I created a new bot and generated a token for it (starts with xoxb as requested) but how do I keep going from there?

Upvotes: 3

Views: 7781

Answers (3)

Erik Peña
Erik Peña

Reputation: 1

It wasn't mentioned by OP but if your target Slack channel is a private channel, you'll also need to ensure that you've added the bot to the private channel so that it is able upload an image to it.

You can do this by viewing the channel's details, clicking "More" and then "Add apps". On the screen that shows up, you should be able to search for the bot that you created and click the "Add" button aside it.

Good luck!

Upvotes: 0

vipul gupta
vipul gupta

Reputation: 11

Please assign this permission in your Slack app then try:

enter image description here

Upvotes: 1

Oluwafemi Sule
Oluwafemi Sule

Reputation: 38962

Go to <grafana_host>/alerting/notification/new (or click the top-left Menu icon, select "Alerting", select "Notification Channels", click the green "New Channel" button). You should get the page in the screenshot below.

Do the following steps:

  • Set "Name" for the channel.
  • Set the channel "Type" to Slack.
  • Check "Include image" option.
  • In "Slack settings", set "URL" to incoming webhook you created in Slack.
  • Set "Token" to bot token generated for bot.

And voila!

Screenshot to Create Slack notification channel in Grafana

Update

Ability to configure a Slack token was added in Grafana version 4.6.0

Upvotes: 0

Related Questions