looker / lookerbot

Lookerbot lets you access all your Looker data from Slack! Super fun!
https://looker.com/lookerbot
MIT License
169 stars 141 forks source link

Post PDFs of dashboards via webhook #58

Open rjnordeen opened 7 years ago

rjnordeen commented 7 years ago

We'd love to be able to schedule a dashboard to post to slack via looker bot

dataist commented 7 years ago

you can, its documented on the main page:

Scheduling Data to Slack

You can use the bot to send scheduled Looks to Slack.

  1. Click "Schedule" on a Look

  2. Set "Destination" to "Webhook"

  3. Leave "Format" set to "HTML Attachment". The format selection is ignored.

  4. Enter the webhook URL.

    • Post to public channels /slack/post/channel/my-channel-name
    • (Lookerbot will need to be invited to this channel to post in it.)
    • Post to private groups /slack/post/group/my-channel-name
    • (Lookerbot will need to be invited to this group to post in it.)
    • To direct message a user /slack/post/dm/myusername

    These URLs are prefixed with the URL your bot. So, if yoru bot is hosted at https://example.com and you want to post to a channel called data-science, the URL would be https://example.com/slack/post/channel/data-science.

  5. You'll need to make sure that the LOOKER_WEBHOOK_TOKEN environment variable is properly set to the same verification token found in the Looker admin panel.

rjnordeen commented 7 years ago

Thanks - I was actually asking about a dashboard, similar to how you do for email. I have a dashboard with a ton of looks and dont want to schedule them all.

dataist commented 7 years ago

there is a webhook destination option for scheduling dashboards as well looks. Let me know if you try it, when I've attempted scheduling dashboards like looks, I've gotten an error I mention in the issue I just posted.

wilg commented 7 years ago

Apologies, dashboards aren't supported at this time for scheduling.

Do you think you want the dashboard to come through to Slack as a PDF or as a collection of the types of "native" Slack attachments the bot normally sends to Slack?

rjnordeen commented 7 years ago

I think a PDF would be first good step, not sure how a collection of native slack attachments would look

greg-finley commented 7 years ago

How much work would this be for you guys? I also vote PDF.

wilg commented 7 years ago

I think this can be made to work, we've got some other things happening in this space that may make this a bit easier in the relatively near term.

ernestoongaro commented 6 years ago

+1

meyerjoe83 commented 6 years ago

@wilg This has been open for a year now. Any progress on this? Sending looks via slack is great, but being able to send one consolidated dashboard would be more ideal. Doesn't look like there has been much activity on this in a while.

ilya-aby commented 6 years ago

@wilg Is sending dashboards through webhooks officially supported yet? I can set it up in the interface, but I get a "Error: request entity too large" for a dashboard with 6 tiles, regardless of whether I try to post it as a PDF or anything else.

wilg commented 6 years ago

I believe sending dashboards is supported via webhooks.

The Slack Action (which is different than Lookerbot) should support sending dashboard PDFs today: https://docs.looker.com/admin-options/platform/actions

wilg commented 6 years ago

Oops to clarify I believe Looker supports sending dashboards to webhooks, but Lookerbot does not. Are you talking about receiving it via Lookerbot or by some custom webhook service you've created?

ilya-aby commented 6 years ago

@wilg we're currently posting looks through a webhook that hits our Lookerbot. We could use Looker actions, but it looks like the Slack action relies on a deprecated Slack token so doesn't seem ideal.

fraser commented 6 years ago

The documentation at https://github.com/looker/actions/blob/master/src/actions/slack/README.md and https://api.slack.com/custom-integrations/legacy-tokens explicitly says not to share Slack legacy tokens with another application, which I think blocks us from using data actions as a way to deliver dashboards into Slack channels.

So, I would like to +1 this issue to have lookerbot support scheduled dashboards since it appears to be the correct way to get this behaviour. (We just implemented lookerbot and I didn't realize this was a limitation at the time. We're still excited to be integrating Looker and data into our discussions in Slack, but this will create a lot of unnecessary work for end-users IMO.)

What is the cause of the error? Is there any way for us to work around it?

Thanks!

wilg commented 6 years ago

We are in the process of moving the Slack Action to use OAuth rather than Slack's legacy token, so that should become an option in the near future for you. We are definitely intending the Slack Action to be a more accessible solution for sending data to Slack that doesn't require setting up a whole server, so we want to support that fully and properly.

It is possible that you can give the Slack Action a "Bot User OAuth Token" instead of a legacy token and it will "just work". (This is the same token Lookerbot uses and there's some instructions on how to find it here: https://github.com/looker/lookerbot#create-a-new-bot-in-slack).

It would be good for Lookerbot to support sending PDFs to Slack as well, but it's simply not supported so various errors are expected. I don't think it would be hugely difficult to add to Lookerbot, but as we are focusing on the Slack Action as our primary push integration with Slack I am not sure if I'll be able to get to it soon. (Lookerbot remains our primary pull solution, where you can pull data into Slack by talking to the bot.)

bayyar commented 6 years ago

Sorry to take things a bit off-topic, but just stumbled on this thread. Is there a rough timeline for the improvements to the Slack Action?

wilg commented 6 years ago

@bayyar Yes, we are hoping for a timeline of one or two months for updating the Slack action to use OAuth. A future version of Looker will support the underpinning additions to the Action API to make OAuth authentication possible, and then we'll need to update the Looker Action Hub (https://github.com/looker/actions) to make use of it.