• EnglishEspañol日本語한국어Português
  • Log inStart now

Roda instrumentation

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:

  1. Add the newrelic_rpm gem to Gemfile and bundle.

    gem 'newrelic_rpm'
  2. In your Roda app, below the Roda require directive, add require 'newrelic_rpm'. For example:

    require 'roda'
    require 'newrelic_rpm'
    class App < Roda
    route do |r|
    r.root do
    "Hello World!"
    end
    end
    end

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!"
end
end

If you want an entire application to be ignored (for example, in a mounted application), call newrelic_ignore without parameters:

newrelic_ignore

Additionally, newrelic_ignore_apdex and newrelic_ignore_enduser are supported.

  • The newrelic_ignore_apdex call will exclude a given route from consideration in overall Apdex calculations.
  • The newrelic_ignore_enduser call 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.

Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.