New Relic RPM Ruby Agent
Switch branches/tags
2.10.2_beta 2.10.4_dev 2.10.5_dev 2.10.6_dev 2.10.7_dev 2.10.8_dev 2.11.0_beta 2.11.0_beta2 2.11.0_dev 2.11.2_dev 2.11.3_dev 2.11.4_dev 2.12.0_dev 2.12.1_dev 2.12.2_dev 2.12.3_dev 2.13.0_dev 2.13.1_dev 2.13.2_dev 2.13.4_dev 2.14.0_dev 2.14.1_dev 3.0.0_dev 3.0.1_dev 3.1.0_dev 3.1.1_dev 3.1.2_dev 3.2.0_dev 3.2.1_dev 3.3.0-with-1.9-gc-fix 3.3.0-with-manual-rum-fix 3.3.0_dev 3.3.0_with_arec_connection_rescue 3.3.1_dev 3.3.2_dev 3.3.2_with_more_granular_timestamps_in_error_messages 3.3.2.1_dev 3.4.0_dev 3.7.3.204_debug_89292 3.16.0 26992-debug 28914-debug 32926-debug 37464-debug-old 37464-debug 42054-debug 43188-debug 43544-debug 48592-debug 50710-debug 54884-debug 55624-debug 63183-debug 73139-fix 78311-debug 78886-debug 83835-debug 88910-debug 92106-debug 98508-debug 99320-debug 99684-debug 100886-debug 112789-debug 115081-debug 136921_debug 139800-debug RUBY-848 RUBY-961 RUBY-1026 RUBY-1111-backport RUBY-1114 RUBY-1148-test RUBY-1158 RUBY-1180 RUBY-1184 RUBY-1187 RUBY-1254-test RUBY-1498-mongo-multiverse agenthooks-fix debug-50319 debug-102844 debug-102999 debug-103103 debug-104324 debug_89292 debug_89731 dev eqt-debug fix_error_collector_error_filter fork_integration gh-pages guard-gemspec-update jruby-test-failures master memstats mobile-header rbx-repro release resque-forking-381-backport resque-forking-396 resque_harvest_locking samg/invalid_query_encoding_fix samg/java-170-compatibility samg/mocha-travis-fix serialization_mini_fix unit_test_with_failure unit_tests with-better-signal-handling
Nothing to show
Clone or download
rachelleahklein and GitHub Enterprise Merge pull request #1812 from ruby-agent/dev
Merge to release for 5.6.0
Latest commit c529a7d Dec 7, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin Scarier warning on nrdebug Dec 2, 2013
cert RUBY-1350: Update certificate with update_ca_bundle rake task. Aug 19, 2014
config RUBY-945 Run Unit Tests in Standalone Mode Nov 14, 2012
lib Bump version for 5.6.0 release Dec 7, 2018
recipes Add license header to source files Feb 22, 2013
test RUBY-2061 Smarter method name mapping for ActiveStorage instrumentation Dec 7, 2018
.gitignore RUBY-2006 Document public Distributed Tracing API Jul 25, 2018
.project Aptana .project file change May 18, 2011
.travis.yml RUBY-2074 Test on Ruby 2.6 preview Dec 1, 2018
.yardopts RUBY-2006 Document public Distributed Tracing API Jul 25, 2018
CHANGELOG.md Edit CHANGELOG for 5.6 release [ci skip] Dec 7, 2018
CONTRIBUTING.md RUBY-1707 Remove references to old Ruby versions in CONTRIBUTING.md Jan 26, 2017
Gemfile move dep from Gemfile to gemspec, note possible bundler issue Nov 29, 2016
Guardfile Run orphaned config tests on changes to default_source.rb Sep 10, 2014
LICENSE Update LICENSE, gemspec, and license tests to reflect removal of vend… Mar 30, 2017
README.md Fix the community forum url Dec 5, 2018
Rakefile RUBY-1695 cleanup/refactor multiverse lib code Jan 6, 2017
config.dot error_collector.max_backtrace_frames configurable Dec 5, 2018
init.rb Point customers to support.newrelic.com if they experience issues. Jan 17, 2014
install.rb Module namespace fixup Jul 22, 2014
newrelic.yml Add Go to the newrelic.yml template comment. Oct 20, 2017
newrelic_rpm.gemspec RUBY-1914: Add Rachel Klein to contributors list Apr 5, 2018

README.md

New Relic Ruby Agent

New Relic is a performance management system, developed by New Relic, Inc (http://www.newrelic.com). It provides you with deep information about the performance of your Rails or Ruby application as it runs in production and transmits them to newrelic.com where you can monitor them in real time. The New Relic Ruby Agent is dual-purposed as a either a Gem or a Rails plugin, hosted on github.

Supported Environments

An up-to-date list of Ruby versions and frameworks for the latest agent can be found on our docs site.

You can also monitor non-web applications. Refer to the "Other Environments" section under "Getting Started".

Contributing Code

We welcome code contributions (in the form of pull requests) from our user community. Before submitting a pull request please review these guidelines.

Following these helps us efficiently review and incorporate your contribution and avoid breaking your code with future changes to the agent.

Getting Started

Add the Ruby Agent to your project's Gemfile.

gem 'newrelic_rpm'

To monitor your applications in production, create an account at http://newrelic.com/ . There you can sign up for a free Lite account or one of our paid subscriptions.

Once you receive the welcome email with a license key and newrelic.yml file, you can copy the newrelic.yml file into your app config directory OR can generate the file manually with command:

newrelic install --license_key="YOUR_KEY" "My application"

The initial configuration is done in the newrelic.yml file. This file is by default read from the config directory of the application root and is subsequently searched for in the application root directory, and then in a ~/.newrelic directory. Once you're up and running you can enable Server Side Config and manage your newrelic configuration from the web UI.

Rails Installation

You can install the agent as a Gem:

For Bundler:

Add the following line to your Gemfile:

gem 'newrelic_rpm'

For Rails 2.x without Bundler:

edit environment.rb and add to the initalizer block:

config.gem "newrelic_rpm"

Sinatra Installation

To use the Ruby Agent with a Sinatra app, add:

require 'newrelic_rpm'

in your Sinatra app, below the Sinatra require directive.

Then make sure you set RACK_ENV to the environment corresponding to the configuration definitions in the newrelic.yml file; e.g., development, staging, production, etc.

Other Environments

You can use the Ruby Agent to monitor any Ruby application. Add:

require 'newrelic_rpm'

to your startup sequence and then manually start the agent using:

NewRelic::Agent.manual_start

For information about instrumenting pure Rack applications, see our Rack middlewares documentation.

Refer to the New Relic's Docs for details on how to monitor other web frameworks, background jobs, and daemons.

The Ruby Agent provides an API that allows custom instrumentation of additional frameworks. You can find a list of community created intrumentation plugins (e.g. newrelic-redis) in the extends_newrelic_rpm project.

Production Mode

When your application runs in the production environment, the New Relic agent runs in production mode. It connects to the New Relic service and sends deep performance data to the UI for your analysis. To view this data, log in to http://rpm.newrelic.com.

NOTE: You must have a valid account and license key to view this data online. Refer to instructions in Getting Started.

Recording Deploys

The Ruby Agent supports recording deployments in New Relic via a command line tool or Capistrano recipes. For more information on these features see our deployment documentation for more information.

Support

You can find more detailed documentation on our website, and specifically in the Ruby category.

If you can't find what you're looking for there, reach out to us on our support site or our community forum and we'll be happy to help you.

Find a bug? Contact us via support.newrelic.com, or email support@newrelic.com.

Thank you, and may your application scale to infinity plus one.

Lew Cirne, Founder and CEO

New Relic, Inc.