As of version 8.0.0 of the Ruby agent, distributed tracing is on by default. Distributed tracing improves on cross application tracing and is recommended for large, distributed systems.
Cross application tracing is deprecated in favor of distributed tracing. If you need to continue using cross application tracing, such as for a non-standard middleware framework, see the configuration information in this document.
Follow these requirements to use cross application tracing with the Ruby agent:
- Make sure the requests being instrumented use a supported HTTP client library.
- Install or update to the latest Ruby agent (version 188.8.131.52 or higher).
- Follow the requirements for middleware installation.
Cross application tracing works with Rack, and therefore requires Rails 2.3 or greater, or another compatible framework.
- If you use Rails, the Ruby agent will install the middleware automatically.
- If you use a different Rack-based framework, manually add the
NewRelic::Rack::AgentHooksmiddleware to your stack.
Cross application tracing can be controlled by a configuration flag. As of version 8.0.0 of the Ruby agent, the default for
false, even when unspecified. To enable cross application tracing, you must set this flag to
true amd set
cross_application_tracer:enabled: truedistributed_tracing:enabled: false
For versions below 8.0.0, cross application can be configured using the following setting.
The external measurement (from the calling application) will always be larger than the internal measurement (from the called application). The external measurement is collected by New Relic's instrumentation of the HTTP client library (such as Net::HTTP). The internal measurement is taken by New Relic's instrumentation of the web framework (such as Rails) in the called application.
Here are some of the major components included in the external measurement that are not included in the internal measurement:
Some of these components are easier to control than others. For example, to capture timings for the Receiving host items above, make sure you have request queue monitoring set up on the receiving application.
As of version 8.0.0 of the Ruby agent, distributed tracing is on by default. Distributed tracing is an improvement on cross application tracing and is recommended for large, distributed systems.