Attributes are key-value pairs containing information that determines the properties of an event or transaction. These key-value pairs can be viewed within transaction traces in APM, traced errors in APM, transaction events in dashboards, and page views in dashboards. You can customize exactly which attributes will be sent to each of these destinations.
These attribute settings apply to version 3.12.0 or higher of the Ruby agent.
Ruby agent attributes
The following table lists the attributes that can be automatically captured by the Ruby agent:
The response status code for a web request. Defaults:
Transaction traces: Enabled
Error collector (traced errors): Enabled
Transaction events: Enabled
Page views (): Unavailable
Note: The httpResponseCode attribute (string value) is deprecated as of agent version 6.12.0. http.statusCode (integer value) should be used instead.
The HTTP referrer header if present (minus the query string). Defaults:
Transaction traces: Disabled
Error collector (traced errors): Enabled
Transaction events: Disabled
Page views (browser monitoring): Unavailable
The HTTP request parameters are associated with the transaction. Available for Rails, Sinatra, Roda and Grape applications only. Defaults:
Transaction traces: Disabled
Error collector (traced errors): Disabled
Transaction events: Disabled
Page views (browser monitoring): Disabled
Job arguments passed to the Resque worker. Arguments passed to Resque workers are positional. These arguments are stored as keys of the form job.resque.args.<position> where position is the index of the argument to the perform method. For example, a Resque job that takes two arguments will have keys job.resque.args.0 and job.resque.args.1. Defaults:
Transaction traces: Disabled
Error collector (traced errors): Disabled
Transaction events: Disabled
Page views (browser monitoring): Unavailable
Note: The resque.capture_params property is deprecated. However, if set to true, it will enable capture of Resque arguments for transaction traces, traced errors.
Job arguments passed to the Sidekiq worker. Arguments passed to Sidekiq workers are positional. These arguments are stored as keys of the form job.sidekiq.args.<position> where position is the index of the argument to the perform method. For example, a Sidekiq job that takes two arguments will have keys job.sidekiq.args.0 and job.sidekiq.args.1. Defaults:
Transaction traces: Disabled
Error collector (traced errors): Disabled
Transaction events: Disabled
Page views (browser monitoring): Unavailable
Note: The sidekiq.capture_params property is deprecated. However, if set to true, it will enable capture of Sidekiq arguments for transaction traces and traced errors.
Adding custom attributes
To capture additional custom attributes from your application, use NewRelic::Agent.add_custom_attributes. For full reference see Collecting custom attributes. Defaults:
Transaction traces: Enabled
Error collector (traced errors): Enabled
Transaction events: Enabled
Page views (browser monitoring): Disabled
Caution
If you want to query your custom parameters or attributes, avoid using any of the reserved terms for naming them.
Upgrading the Ruby agent
When upgrading to Ruby agent 3.12.0 or higher, upgrade your newrelic.yml configuration.