41
loading...
This website collects cookies to deliver better user experience
docker-compose
).
*only required if using the sample application in this post
$ git clone --branch appsignal-setup/start-docker --single-branch https://github.com/choncou/sample_rails_app appsignal-setup
$ cd appsignal-setup
$ yarn start:compose
Post
model, PostsController
, and all CRUD actions exposed via the /posts
route.PagesController
, which enqueues a background job CreateRandomPostsJob
to generate random posts asynchronously../bin/traffic
) running in the background together with the server that regularly makes a few requests to imitate traffic on the applications.Add the gem to your Gemfile
# Gemfile
gem 'appsignal'
Install the gem by running bundle install
inside of the docker container, which you can access with yarn compose:sh
$ yarn compose:sh
# We are now in a bash console within a docker container
$ bundle install
# Stay in this console for the next command
Install AppSignal
During the installation, you'll need to respond to two prompts:
- `Do you want to change how this is displayed in AppSignal? (y/n): n`
- `How do you want to configure AppSignal?` : Input `1` because we will use a config file instead of just environment variables
Use the API key shown on the AppSignal setup page:
```bash
$ bundle exec appsignal install <your-api-key>
...
...
#####################################
## AppSignal installation complete ##
#####################################
Sending example data to AppSignal...
Example data sent!
It may take about a minute for the data to appear on https://appsignal.com/accounts
Please return to your browser and follow the instructions.
```
config/appsignal.yml
which allows you to configure AppSignal settings for different environments. You can learn more in the AppSignal Ruby configuration docs.config/appsignal.yml
is your push API key. You would usually remove it from this file and use an environment variable instead. For this post, that won't be necessary.ctrl-c
inside of the terminal window running the server and start docker-compose again with:$ yarn start:compose
/
) there is a validation error occurring on app/controllers/pages_controller.rb:7 home
.PostsController#index
, we can dive deeper into the controller's performance. You can quickly see a breakdown of where the most time is spent, or the most object allocations happen.config/puma.rb
, add the following line:# config/puma.rb
plugin :appsignal
docker-compose.yml
:# docker-compose.yml
APP_REVISION: "latest_version_tag"
ctrl-c
and start-up docker-compose again with yarn start:compose
.plugin
in the config file has activated a minutely probe that reports metrics about the Puma server.APP_REVISION
environment variable to any value that helps you determine the current version of your application, such as a git commit SHA.