Integrating AppSignal in Ruby

It's possible that AppSignal does not provide automatic integration for your framework of choice, or maybe you're using your own application setup.

See our list of supported integrations to see what frameworks and gems we support with the AppSignal gem.

When AppSignal does not support something using the gem it's still possible to to instrument applications. AppSignal needs to be configured and started once at the beginning of a process. It can be configured through a configuration file or by using environment variables.

Configuration

Environment variables

When using environment variables to configure AppSignal the gem will read the configuration from the environment once it starts. It's as easy as calling Appsignal.start at the beginning of a process.

ruby
require "appsignal" Appsignal.start

Configuration file

When using a configuration file to configure AppSignal, the configuration needs to be initialized beforehand to tell the gem where to look for its configuration.

ruby
require "appsignal" Appsignal.config = Appsignal::Config.new( current_path, "production" ) Appsignal.start

AppSignal will look in the path of the first argument for a config/ directory containing an appsignal.yml file to load the configuration. The second argument is the environment it will load from the configuration file.

Next steps

Continue with our instrumentation for scripts and background jobs guide for applications that we don't automatically instrument. Use instrumentation helpers to break down the instrumented code in more detail.