Slack alerts with images

I’ve setup a notification channel using Slack and while it is working well, I’d like to use the option to include the image.
My grafana server is not available from the internet, so I’ve added a Slack bot token so it can use the upload API and include the image, however, this isn’t working.

I’ve setup this bot (Bots | Slack App Directory) and put the token into the Grafana config.

When I test the alert, Grafana shows an error, however, the alert still gets sent, although without an image.

Has anybody successfully got Slack alerts working from an internal server with image uploads?

I have the same issue. (although I don’t get an error message when I test the alert).
The grafana log says:
t=2017-12-02T10:11:15-0600 lvl=info msg=“Sending notification” logger=alerting.notifier type=slack id=0 isDefault=false
t=2017-12-02T10:11:15-0600 lvl=info msg=“Executing slack notification” logger=alerting.notifier.slack ruleId=0 notification=SlackChan
t=2017-12-02T10:11:15-0600 lvl=info msg=“Uploading to slack via file.upload API” logger=alerting.notifier.slack
but no image is shown.
I’m not sure whether the issue is caused by the slack bot setup or by grafana.

I just found out what was wrong:
For the alert messages, the incoming-webhook had a default channel, that’s why I didn’t specify the “Recipient” in the grafana slack configuration.
For the bot to work, I simply had to specify the channel you want to post the images in, because it doesn’t ‘know’ about the webhook default settings…
Hope that helps you, too.

I’ve tried this solution. I setup a Slack app with a bot user and an incoming webhook, specified the recipient and token from the app’s bot config. I’m getting the images but they are showing up in a second post from the alert.

What am I missing here to get this all in a single post?

Change the “domain” config in grafana.ini fixed my issue

Good day,
I configured the slack notification channel via webhook however whenever there is an alert, my bot keeps uploading the same image which is used in the test notification. What could be causing this?

I’m getting the same behavior.

The way we got a fix was to manually download phantomjs and copy paste it to grafana/tools directory.

From the document,

If you are using the token for a slack bot, then you have to invite the bot to the channel you want to send notifications and add the channel to the recipient field.

Do u have any document for Integrating grafana with slack

Hi Do you have steps? for Grafana sending notifications (Images) to slack.

I found if you use slack bot user to send a snapshot image, it will send in separated post.
For sending image and message in a single post, you have to configure external image storage for Grafana like s3, etc…

1 Like

having the same issue with external storage local,

OK - I have the same issue, I get the alert but no image. New install with Grafana 6.7.0. I am posting using the Slack bot config. Grafana is running in a Docker container.

In Grafana logs I see a log entry with no errors:

t=2020-03-20T10:06:59+0000 lvl=info msg=“Executing slack notification” logger=alerting.notifier.slack ruleId=0 notification=Slack
t=2020-03-20T10:06:59+0000 lvl=info msg=“Uploading to slack via file.upload API” logger=alerting.notifier.slack
t=2020-03-20T10:13:54+0000 lvl=dbug msg=“Sending webhook” logger=notifications url= http method=POST