Smart, Serverless, Slack: Automated Weekly Reports

Share this post:

Serverless actions save time and resources

The code for the GitHub traffic statistics has been extended by automated weekly reports that are posted to Slack. It shows how serverless actions save time and resources. In this case, an IBM Cloud Function creates a report from a Db2 database and then posts it into a Slack channel. A few seconds of serverless actions save minutes of manual work.

Architecture - Traffic Analytics

Architecture – Traffic Analytics


In an earlier blog post, I introduced you to an IBM Cloud solution tutorial for automatic retrieval and analytics of GitHub traffic data. GitHub offers traffic statistics for the code repositories. They provide insights into traffic sources, number of views, and clones. Unfortunately, only the data for the most recent 14 days are available. Using the cloud solution, a serverless actions automatically retrieves the data and stores it in Db2 Warehouse on Cloud. There, it can be reviewed and analyzed across repositories and over time.

I am interested in the GitHub traffic data because I write and publish code, share material related to my talks, and publish code snippets for my blog posts. Up to this point, I manually pulled the reports when I had time. Enter the new code and the resulting time saved.

Automated Slack messages

I extended the existing solution by a new IBM Cloud Functions action. That function pulls data from Db2 and composes a report. Thereafter, that action publishes the report as a new message to my team’s Slack channel. Slack supports incoming webhooks that allow an easy, quick, and secure way for external services to publish messages. The report is kicked off by an IBM Cloud Functions alarm. It triggers the execution once a week when all statistics for the previous week are available. A few seconds later, my team sees something like the following:

GitHub Traffic Bot on Slack

GitHub Traffic Bot on Slack


To get an overview of this solution and to get ideas for utilizing serverless actions for smart solutions, check out these resources:

If you have feedback, suggestions, or questions about this post, please reach out to me on Twitter (@data_henrik) or LinkedIn.

Technical Offering Manager / Developer Advocate

More How-tos stories
May 3, 2019

Kubernetes Tutorials: 5 Ways to Get You Building Fast

Ready to start working with Kubernetes? Want to build your Kubernetes skills? The five tutorials in this post will teach you everything you need to know about how to manage your containerized apps with Kubernetes.

Continue reading

May 3, 2019

Using Portworx to Deploy and Manage an HA MySQL Cluster on IBM Cloud Kubernetes Service

This tutorial is a walkthrough of the steps involved in deploying and managing a highly available MySQL cluster on IBM Cloud Kubernetes Service.

Continue reading

May 2, 2019

Kubernetes v1.14.1 Now Available in IBM Cloud Kubernetes Service

We are excited to announce the availability of Kubernetes v1.14.1 for your clusters that are running in IBM Cloud Kubernetes Service. IBM Cloud Kubernetes Service continues to be the first public managed Kubernetes service to support the latest upstream versions from the community.

Continue reading