Getting started with Grafana on Scalingo

Grafana is an open source monitoring and visualization solution. It gives you the ability to produce dashboards about your application metrics.

This tutorial will show you how to deploy a Grafana instance on Scalingo in under 5 minutes.

Grafana Deployment

We published a repository grafana-scalingo on GitHub to help you deploy Grafana on Scalingo. Deploying a Grafana instance is now at a click range:

Deploy

Deployment by Cloning the Repository

You first need to create an application on Scalingo. Let’s say its name is my-app.

Then, clone our repository and add the Scalingo git remote:

$ git clone https://github.com/Scalingo/grafana-scalingo
$ cd grafana-scalingo
$ git remote add scalingo git@ssh.osc-fr1.scalingo.com:my-app.git

We now need to slightly configure the Scalingo application. First, this application needs to use the multi-buildpacks. Add the BUILDPACK_URL environment variable:

$ scalingo --app my-name env-set BUILDPACK_URL=https://github.com/Scalingo/multi-buildpack.git

You also need to add a PostgreSQL addon to your application. Last, configure a few Grafana specific environment variables by heading to your application web dashboard:

GF_DATABASE_URL=$SCALINGO_POSTGRESQL_URL
GF_PATHS_PLUGINS=/app/plugins
GF_SECURITY_ADMIN_PASSWORD=<Fill this field>
GF_SECURITY_ADMIN_USER=<Fill this field>
GF_SERVER_HTTP_PORT=$PORT
GF_SERVER_ROOT_URL=https://my-app.osc-fr1.scalingo.io
NPM_CONFIG_PRODUCTION=false
PLATFORM_ENV=production

You need to customize the variables GF_SECURITY_ADMIN_USER, GF_SECURITY_ADMIN_PASSWORD and GF_SERVER_ROOT_URL with correct values.

You can now deploy your application with:

$ git push scalingo master

Display Images on External Services

You may want to display images on the alerts generated by Grafana and sent, for example, on Slack. For this you need an S3 bucket configured via the following environment variables:

GF_EXTERNAL_IMAGE_STORAGE_PROVIDER=s3
GF_EXTERNAL_IMAGE_STORAGE_S3_ACCESS_KEY=<Fill this field>
GF_EXTERNAL_IMAGE_STORAGE_S3_BUCKET=<Fill this field>
GF_EXTERNAL_IMAGE_STORAGE_S3_REGION=<Fill this field>
GF_EXTERNAL_IMAGE_STORAGE_S3_SECRET_KEY=<Fill this field>

mode_edit Suggest edits