Starting in version 2.10, New Relic's Ruby agent works with Sinatra. Sinatra 1.2.x and higher is supported.
Sinatra actions appear in the user interface similar to controller actions with breakdown charts and transaction traces. Error collection and cross application tracing are available as well.
The actions in the UI correspond to the pattern expression used to match them. HTTP operations are not distinguished. Multiple matches are all tracked as separate actions.
To get started, install the latest
newrelic_rpm gem and do
in your Sinatra app, below the Sinatra require directive.
RACK_ENV to the environment corresponding to the configuration definitions in the
newrelic.yml file; i.e., development, staging, production, etc.
Note: Developer mode only works with Rails.
Versions of the Ruby agent prior to 3.6.3 required manual addition of New Relic middlewares to enable certain features such as cross-application tracing and real user monitoring auto-instrumentation.
See Rack Middlewares for detailed instructions on the middlewares necessary, or upgrade to the most recent agent.
Version 3.6.3 and later of the Ruby agent support ignoring certain routes, similar to what's previously been available in Rails controller instrumentation.
Ignores are specified via the same style of routes used to define your Sinatra application. For example, to ignore a
ping route in a Sinatra app, you would include the following code in the app:
If you want an entire application to be ignored (in a mounted application for instance), you can simply call
newrelic_ignore without parameters:
newrelic_ignore_enduser are supported.
newrelic_ignore_apdex will exclude a given route from consideration in overall apdex calculations.
Padrino is a framework built on top of Sinatra. Starting with Ruby agent version 3.6.3, New Relic's Sinatra instrumentation works with Padrino. Versions 0.10.x and later of Padrino are supported.
The New Relic Ruby agent will not work with shotgun. It cannot make a connection before the dispatcher process exits. Neither Developer mode nor Monitor mode will work.
If you need additional help, get support at support.newrelic.com.