lookerbot icon indicating copy to clipboard operation
lookerbot copied to clipboard

Post PDFs of dashboards via webhook

Open rpoo2 opened this issue 9 years ago • 17 comments

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

rpoo2 avatar Feb 01 '17 20:02 rpoo2

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.

  1. 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.

dataist avatar Feb 09 '17 16:02 dataist

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.

rpoo2 avatar Feb 09 '17 16:02 rpoo2

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.

dataist avatar Feb 09 '17 17:02 dataist

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?

wilg avatar Feb 09 '17 18:02 wilg

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

rpoo2 avatar Feb 09 '17 19:02 rpoo2

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

greg-finley avatar Jun 16 '17 00:06 greg-finley

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.

wilg avatar Jun 16 '17 00:06 wilg

+1

ernestoongaro avatar Jan 30 '18 20:01 ernestoongaro

@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.

meyerjoe83 avatar Apr 07 '18 13:04 meyerjoe83

@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.

ilya-aby avatar Jun 18 '18 04:06 ilya-aby

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 avatar Jun 18 '18 23:06 wilg

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?

wilg avatar Jun 18 '18 23:06 wilg

@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.

ilya-aby avatar Jun 19 '18 05:06 ilya-aby

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!

fraser avatar Jun 21 '18 16:06 fraser

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.)

wilg avatar Jun 21 '18 17:06 wilg

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?

bayyar avatar Jul 03 '18 02:07 bayyar

@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.

wilg avatar Jul 03 '18 16:07 wilg