Agent attributes

Attributes are key-value pairs containing information that determines the properties of an event or transaction. You can view these key-value pairs within transaction traces, and in Insights or other products which use event data. New Relic gives users the ability to customize exactly which attributes will be sent to each of these destinations.

You can also collect custom attributes to send additional data to APM and Insights.

Attribute destination flow

The following diagram illustrates how an agent decides to send attributes to each destination.

nr attribute collection diagram.png
Agent attribute collection: An agent makes three different decisions when sending an attribute to any New Relic destination based on the relevant property settings. Property names and syntax vary by agent. (The properties in this diagram are specific to the PHP agent, but the general flow is the same for all agents. Property names and syntax vary by agent.)

Types of attributes

Attributes can be collected in a variety of ways:

  • Message property attributes: These are the properties set on a message received from a queue or topic.
  • HTTP request attributes: These are the parameters for an HTTP request.
  • User attributes: These are attributes provided by the user through each agent's API.
  • Agent attributes: These are attributes captured by the agent; for example, httpResponseCode and httpResponseMessage.

Destinations for attributes

Collected attributes appear in these locations:

Collected attributes Location
Transaction traces Each minute transaction traces collect data for your slowest individual HTTP requests. These traces will report attributes collected during the transaction.
Traced errors If a transaction results in an error, these traced errors will be reported to New Relic APM. A traced error will contain attributes collected during the transaction.
Insights transaction events APM transactions that are reported to New Relic Insights will contain attributes collected during the transaction.
Insights page views

Browser page views reported to New Relic Insights will contain attributes collected during the transaction. However, attributes collected at the end of a transaction may not appear under Insights PageView events.

Note: This destination is also called browser monitoring.

Viewing request attributes

Request attributes are associated with specific transaction traces, browser traces, and errors in New Relic APM and New Relic Insights. You can see the attributes recorded with a request when viewing the individual trace or error. In Insights, custom attributes can be queried via NRQL exactly like any other attribute.

screen-tx-trace-attributes.png
APM > (selected app) > Monitoring > Transactions > (selected transaction) > (selected trace): Here is an example from the Ruby agent of the Request attributes and Custom attributes for a transaction trace. Exact attributes depend on your agent and on your attribute configuration.

Limits

User attributes, request attributes, and message queue parameters are limited by count and size.

Parameter Limitations
Transaction Limited to 64 user attributes
Attribute key

Limited to 256 bytes each

If the key is over 256 bytes, then the attribute will not be recorded.

Attribute value

Limited to 256 bytes each

If the value is > 256 bytes, then the attribute value will be truncated.

Agent specific attributes

For more information about the attributes supported for a specific agent, see the agent's attributes documentation if available:

For more help

Additional documentation resources include Collecting custom attributes (capturing and viewing standard HTTP attributes, as well as custom attributes, with specific destinations).

Join the discussion about New Relic APM in the New Relic Online Technical Community! The Technical Community is a public platform to discuss and troubleshoot your New Relic toolset.

If you need additional help, get support at support.newrelic.com.