The New Relic Ruby agent automatically instruments Roda 3.19.0 and higher.
Important
Roda instrumentation requires Ruby agent version 9.4.0 or higher.
Getting started
To set up your Roda app with New Relic:
Add the
newrelic_rpmgem to Gemfile and bundle.gem 'newrelic_rpm'In your Roda app, below the Roda
requiredirective, addrequire 'newrelic_rpm'. For example:require 'roda'require 'newrelic_rpm'class App < Rodaroute do |r|r.root do"Hello World!"endendend
Ignoring routes
Ruby agent versions 9.6.0 or higher support ignoring certain routes. To specify these values, use the same style of routes that you use to define your Roda application. For example, to ignore a hello_world route in a Roda app, declare newrelic_ignore '/hello_word' outside the route block:
newrelic_ignore '/hello_world'
route do |r| r.on '/hello_world' do "Hello World!" endendIf you want an entire application to be ignored (for example, in a mounted application), call newrelic_ignore without parameters:
newrelic_ignoreAdditionally, newrelic_ignore_apdex and newrelic_ignore_enduser are supported.
- The
newrelic_ignore_apdexcall will exclude a given route from consideration in overall Apdex calculations. - The
newrelic_ignore_endusercall will prevent automatic injection of the page load timing JavaScript when a route is rendered.
Important
All newrelic_ignore* methods must be called outside the route block.
Rack instrumentation
As a Rack-based framework, Roda instrumentation requires Rack instrumentation to work properly. Rack instrumentation is enabled by default.