Skip to content

Instantly share code, notes, and snippets.



Last active Jan 4, 2016
What would you like to do?
Setting up AppSignal on Shelly Cloud

Setting up AppSignal on Shelly Cloud

To set up AppSignal on Shelly Cloud, you first have to add both the dotenv-rails and the appsignal gem to your Gemfile. Make sure that the dotenv-rails gem is the very first gem in your Gemfile as it will set up important environment variables as soon as it is required.

# Gemfile

source ''

gem 'dotenv-rails'
gem 'appsignal'

# All of your other gems

Next, you have to create a new configuration file for your cloud to set up the APPSIGNAL_PUSH_API_KEY environment variable. This is pretty simple using shelly config create .env and enter this as its content:

APPSIGNAL_PUSH_API_KEY: your-appsignal-push-api-key-here

Finally make sure you have a proper config/appsignal.yml file set up. Simply create it with something similar to this as its content:

default: &defaults
  push_api_key: "<%= ENV['APPSIGNAL_PUSH_API_KEY'] %>"

  # Your app's name
  name: "Your app's name here"

  # The cuttoff point in ms above which a request is considered slow, default is 200
  # slow_request_threshold: 200

# Configuration per environment, leave out an environment or set active
# to false to not push metrics for that environment.
  <<: *defaults
  active: false

  <<: *defaults
  active: true

Thats it! After pushing your changes to Shelly Cloud, you should be seeing data showing up in AppSignal soon.

Bonus: Deployment notifications

If you want to get deployment notifications every time you deploy a new version of your application to Shelly Cloud, simply create a file called config/deploy/shelly/after_successful_deploy:

set -e

bundle exec dotenv appsignal notify_of_deploy --revision=$DEPLOYED_REVISION --user=$DEPLOY_AUTHOR --environment=$RAILS_ENV 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment