How-tos

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

Overview

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

Summary

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
February 13, 2019

Simplify and Automate Deployments Using GitOps with IBM Multicloud Manager 3.1.2

Use Argo CD, a GitOps continuous delivery tool for Kubernetes, and IBM Multicloud Manager to achieve declarative and automated deployment of applications to multiple Kubernetes clusters.

Continue reading

February 11, 2019

Solving Business Problems with Splunk on IBM Cloud Kubernetes Service

In this tutorial, we will install Splunk Connect for Kubernetes into an existing Splunk instance. Splunk Connect for Kubernetes provides a way to import and search your Kubernetes logging, object, and metrics data in Splunk.

Continue reading

February 8, 2019

A How-To for Migrating Redis to IBM Cloud Databases for Redis

If you’re moving your data over to IBM Cloud Databases for Redis, you’ll need to take some steps to successfully migrate all of your data. We’ve got you covered. In this post, we’ll show you a quick way to start migrating your data across to Databases for Redis, whether your database is on-premise or in the cloud.

Continue reading