Running AWS Athena queries from Slack
How can you query Athena from within Slack?
Athena is a powerful AWS tool which lets you query data from a variety of sources using SQL. We love SQL here at Transposit. It has a friendly user interface that you can use when logged into the AWS console. But sometimes you just want to run a query from within your Slack application. There's a (Transposit) app for that.
You might want to see the latest user signups, or the delta of application errors between this week and last. This type of ad-hoc querying is a good fit for direct Athena queries (assuming, of course, that this data is available in Athena).
Things to watch out for:
- timing. If the query takes more than two minutes, this application will timeout. Might be better to use a different interface.
- cost. Athena charges based on how much data it examines. You don't have any feedback on that with the Slack interface, so beware of queries with large numbers of results or that might touch a lot of data.
- query building. I find it is easiest to build my query in a text editor and then cut and paste it. This allows for easier iteration than doing it all within the Slack window.
If you'd like to install this application, see the sample application for full details. You'll probably want to fork it. There's also a longer blog post which dives into much more detail.
May the Slack be with you.