Analytics for web and mobile rely on events to deliver insights. For chat bots, on the other hand, insights comes from analyzing the content of conversations. Botmetrics accomplishes this with several services—collectors, workers, and a web app for interfacing with the user. These need to be setup separately and configured to work in concert.

Botmetrics Architecture Diagram

Convox makes it almost trivial to bring up this mix of Go and Ruby services in a coordinated and scalable way. We’re going to assume that you already have a Rack set up and the Convox CLI installed. If not, follow The Convox Getting Started Guide to set up your laptop and cloud environment.

Setting up the Botmetrics App

Clone the Botmetrics repo and in your botmetrics directory issue the following commands to set up the app:

convox apps create to create an application called botmetrics

convox apps info to check if the app has been created

Checking on App Status

Adding Databases

We will use the RDS Postgres and ElastiCache Redis services from Amazon which allow us to scale as needed with minimal effort.

Provisioning a Postgres database and Redis key store is easy with Convox:

convox services create postgres

convox services create redis

convox services to see the names and provisioning status of the services

Getting Service Names

Deploying to Production and Initial Setup

Now it’s time to deploy the app. Kick it off with convox deploy. (Time to go surf reddit.)

Setting up the Environment

Next, we need to set the environment variables for Redis and Postgres so that web and worker services can access the databases we just provisioned.

For each service instance (Redis and Postgres) you can get the URL with:

convox services info <service_instance_name>

Then set the environment variables REDIS_URL for Redis and DATABASE_URL for Postgres with:

convox env set <VARIABLE_NAME> <URL>

Setting the REDIS_URL and DATABASE_URL Environment Variables

You then need to set a few other environment variables that are required for Botmetrics to boot up in production mode: