Module: NewRelic

Defined in:
lib/new_relic/agent.rb,
lib/newrelic_rpm.rb,
lib/new_relic/stats.rb,
lib/new_relic/control.rb,
lib/new_relic/version.rb,
lib/new_relic/metric_data.rb,
lib/new_relic/metric_parser.rb,
lib/new_relic/local_environment.rb,
lib/new_relic/transaction_sample.rb,
lib/new_relic/commands/deployments.rb,
lib/new_relic/agent/instrumentation/rack.rb,
lib/new_relic/agent/samplers/object_sampler.rb,
lib/new_relic/agent/instrumentation/active_record_instrumentation.rb

Overview

New Relic Agent

New Relic RPM is a performance monitoring application for Ruby applications running in production. For more information on RPM please visit www.newrelic.com.

The New Relic Agent can be installed in Rails applications to gather runtime performance metrics, traces, and errors for display in a Developer Mode UI (mapped to /newrelic in your application server) or for monitoring and analysis at rpm.newrelic.com with just about any Ruby application.

For detailed information on configuring or customizing the RPM Agent please visit our support and documentation site.

Starting the Agent as a Gem

For Rails, add:

config.gem 'newrelic_rpm'

to your initialization sequence.

For merb, do

dependency 'newrelic_rpm'

in the Merb config/init.rb

For Sinatra, just require the newrelic_rpm gem and it will automatically detect Sinatra and instrument all the handlers.

For other frameworks, or to manage the agent manually, invoke NewRelic::Agent#manual_start directly.

Configuring the Agent

All agent 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

Using with Rack/Metal

To instrument middlewares, refer to the docs in NewRelic::Agent::Instrumentation::Rack.

Agent API

For details on the Agent API, refer to NewRelic::Agent.

:main: lib/new_relic/agent.rb

Defined Under Namespace

Modules: Agent, Commands, Metrics, Rack, Stats, TransactionAnalysis, VERSION Classes: ApdexStats, BasicStats, ChainedCall, Control, Histogram, LocalEnvironment, MerbBootLoader, MethodTraceStats, MetricData, MetricParser, MetricSpec, NoticedError, ScopedMethodTraceStats, StatsBase, TransactionSample, VersionNumber

Constant Summary collapse

COLLAPSE_SEGMENTS_THRESHOLD =
2
MYSQL_EXPLAIN_COLUMNS =
[
  "Id",
  "Select Type",
  "Table",
  "Type",
  "Possible Keys",
  "Key",
  "Key Length",
  "Ref",
  "Rows",
  "Extra"
].freeze