Last active
January 4, 2016 06:09
-
-
Save benedikt/8580033 to your computer and use it in GitHub Desktop.
Setting up AppSignal on Shelly Cloud
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Setting up App Signal 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. | |
```ruby | |
# Gemfile | |
source 'https://rubygems.org' | |
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 the `shelly config create .env` and enter this as its content: | |
```yaml | |
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: | |
```yaml | |
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. | |
development: | |
<<: *defaults | |
active: false | |
production: | |
<<: *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`: | |
```bash | |
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