Skip to content

Instantly share code, notes, and snippets.

@benedikt
Last active January 4, 2016 06:09

Revisions

  1. benedikt revised this gist Jan 23, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Howto.md
    Original file line number Diff line number Diff line change
    @@ -13,7 +13,7 @@ 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:
    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:

    ```yaml
    APPSIGNAL_PUSH_API_KEY: your-appsignal-push-api-key-here
  2. benedikt revised this gist Jan 23, 2014. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion Howto.md
    Original file line number Diff line number Diff line change
    @@ -51,4 +51,5 @@ If you want to get deployment notifications every time you deploy a new version
    ```bash
    set -e
    bundle exec dotenv appsignal notify_of_deploy --revision=$DEPLOYED_REVISION --user=$DEPLOY_AUTHOR --environment=$RAILS_ENV ```
    bundle exec dotenv appsignal notify_of_deploy --revision=$DEPLOYED_REVISION --user=$DEPLOY_AUTHOR --environment=$RAILS_ENV
    ```
  3. benedikt revised this gist Jan 23, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Howto.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # Setting up App Signal 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.

  4. benedikt renamed this gist Jan 23, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  5. benedikt created this gist Jan 23, 2014.
    54 changes: 54 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,54 @@
    # 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 ```