Question

Using Lookerbot for Slack


Userlevel 5
Badge

The content in this post has been updated and moved to the Looker Help Center. Please visit the Using Lookerbot for Slack article for more information about Lookerbot. 

 


54 replies

Looks great - are you building one for Hipchat?

Have you tried running this in AWS Lambda yet? You wouldn’t need a server then if it works.

Userlevel 2

+1 for a Hipchat bot

@Mark_Brown what would you see as the event source to the Lambda?

API gateway to expose it as a service I suppose. I haven’t had a chance to look yet. I used lambda when playing around with the Looker API. I used the API gateway to call a lambda function that made requests to the Looker API. It had a bit of lag but worked fine to get data and display it in a simple nvd3 chart.

My point of concern was that (unless i misunderstand), a slackbot needs to listen - there isn’t any process for sending it an event. It listens to the channel(s) it belongs to.


I’m a big Lambda advocate: have used it successfully and surprisingly smoothly with both API Gateway and Kinesis stream as sources. That being said, I don’t see a way for it to work here without an additional process to listen to the channel and send the events to API Gateway or whatever. The cost of that is, in my mind, more than that of running a server for the bot itself (which is tailor-made for listening to slack channels).

Userlevel 2

Does a query rerun when the Slack page is reloaded, or is it run only when the Slack user initially calls for it?

Userlevel 2

Now that Version 0.0.3 is out - is there an easy way to update? I’m using Heroku as per the docs.

Userlevel 1

+1 Lookerbot for HipChat!

Are there any good hacks for staying on Hobbyist Heroku tier but keeping the dynos active during business hours? We keep needing to restart the bot due to idling

In Lookerbot’s help menu listing the available commands, you can get a description of the dashboard that gets returned. To do this:



  1. In Looker, navigate to the dashboard.

  2. If you are using dashboard locks, unlock the dashboard.

  3. Click the dashboard’s gear and choose Edit Dashboard Settings.

  4. In the Description field, enter the description you want to appear in the Lookerbot help menu.

  5. Click Save.

  6. If you are using dashboard locks, lock the dashboard.

xref https://discourse.looker.com/t/hosted-slack-lookerbot/2334


This is super helpful, Wil. We’ve been using the bot for a few days now and ran into this issue, with confusion, because I wasn’t the one who set the server up.

Hello Wilg


I am excited about the potential of this integration, however has not been possible to make it effective, we follow the steps that indicate the readme, but both heroku, and local environment have the same answer: “Can not GET /”. We think that if it works in the local environment, deploy to Heroku can be manageable, however localhost: 5000, we have the same result, if someone who has been successful in the looker-slack connection, we can help or recommend a solution we were immensely grateful.


Attached is the log of npm in the local environment:


Scuti:looker-slackbot jhofeloto$ heroku local

[okay] Loaded ENV .env File as KEY=VALUE Format

10:16:09 AM web.1 | > looker-slackbot@0.0.4 start /Users/jhofeloto/Proyectos/looker-slackbot

10:16:09 AM web.1 | > coffee lib/bot.coffee

10:16:10 AM web.1 | Using Looker information specified in individual environment variables.

10:16:10 AM web.1 | info: ** No persistent storage method specified! Data may be lost when process shuts down.

10:16:10 AM web.1 | info: ** Setting up custom handlers for processing Slack messages

10:16:11 AM web.1 | info: ** API CALL: https://slack.com/api/rtm.start

10:16:11 AM web.1 | info: ** API CALL: https://slack.com/api/team.info

10:16:11 AM web.1 | info: ** Starting webserver on port 5000

10:16:11 AM web.1 | info: ** Serving webhook endpoints for Slash commands and outgoing webhooks at: http://MY_HOST:5000/slack/receive

10:16:11 AM web.1 | info: Warning: using temporary storage. Data will be lost when process restarts.

10:16:11 AM web.1 | Saved the team information…

10:16:11 AM web.1 | notice: ** BOT ID: jhofeloto …attempting to connect to RTM!

10:16:11 AM web.1 | Updated API token for https://argus.looker.com:19999/api/3.0

10:16:11 AM web.1 | Refreshing custom commands for https://argus.looker.com


Thanks in advance, excuse me for my English are from Colombia 😉

Wilg


Thank you very much, and we solved, our mistake was that we were using the API WEB TOKEN (https://api.slack.com/web) of SLACK instead of which we provided the BOT SLACK, this confusion was generating the impossibility of connection. And we change and everything worked perfectly.


Thank you!

Is there a way to get rendered images in slack?


here is my look in Looker


and here is my look in slack

Is there a way to configure a custom command not to get results from cache and to run the query instead?

Userlevel 2

Hi @jesko!


It is currently not possible to clear cache and refresh a look directly though Lookerbot. I’ll pass your idea to our product team on your behalf.


As a workaround you can specify persist_for on the explores your Lookerbot is running on.

Thanks @aleks, would be nice to be able to do this via the Lookerbot rather than changing persist_for.


Also, any idea why it’s not possible for us to use to Lookerbot to access the i_looker model? The bot gives me a “forbidden” message. One example use for this is that we regularly need to check PDT avg build times and daily build counts for specific PDTs similar and it would be useful to be able to ask the bot for this info.


See this example for a specific PDT, we’d use a command similar to “@looker pdt builds {pdt_name}”:

Userlevel 5
Badge

Just a thought here @jesko - does the user to which the bot’s API credentials are connected have Admin privileges?

The i__looker model is only accessible by admins, so this would be a prerequisite. There may be something else special about i__looker that prevents Lookerbot from working here, but that would be my first guess.

@sam, thanks for the quick response, that’s most probably the reason, we didn’t quite trust our Lookerbot enough to give him admin rights 🙂

Userlevel 5
Badge

Totally fair @jesko 🙂 That’s a lot of power to give all your Slack users!

@jesko That’s a cool PDT chart. Would you mind sharing where you’re pulling that data from in Looker?

@dengstrom, you’ll need to go to the i_looker explore here: https://yourcompany.looker.com/explore/i__looker/history


Then you filter for:

History Source = Other

History Message = Building derived table YOUR_PDT_NAME


And the fields I selected:

History Created Date

History Query Run Count

History Average Runtime

Userlevel 5
Badge

@dengstrom you might also find this intro to the i__looker history explore helpful.

Reply