Java agent attributes

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 New Relic APM, traced errors in New Relic APM, transaction events in Insights, and page views in Insights. You can customize exactly which attributes will be sent to each of these destinations.

These attribute settings apply to version 3.7.0 or higher of the Java agent.

Java agent attributes

The following table lists the attributes that can be configured in the Java agent. For more information, see Java agent configuration: Attributes.

httpResponseCode

The response status code for a web request. Defaults:

  • Transaction traces: Enabled
  • Error collector (traced errors): Enabled
  • Transaction events: Enabled
  • Page views (browser monitoring): Unavailable
httpResponseMessage

The response status message if present for a web request. Defaults:

  • Transaction traces: Enabled
  • Error collector (traced errors): Enabled
  • Transaction events: Disabled
  • Page views (browser monitoring): Unavailable
jvm.thread_name

The name of the thread. Defaults:

  • Transaction traces: Enabled
  • Error collector (traced errors): Enabled
  • Transaction events: Disabled
  • Page views (browser monitoring): Unavailable
jvm.lock_thread_name

The name of a locked thread. Defaults:

  • Transaction traces: Unavailable
  • Error collector (traced errors): Enabled
  • Transaction events: Unavailable
  • Page views (browser monitoring): Unavailable
NewRelic.addCustomParameter API call

Attributes added to an addCustomParameter call on the New Relic API. Defaults:

  • Transaction traces: Enabled
  • Error collector (traced errors): Enabled
  • Transaction events: Disabled
  • Page views (browser monitoring): Disabled

Before creating custom attributes, review New Relic's list of reserved terms used by NRQL and Insights. Otherwise unexpected results may occur.

NewRelic.noticeError API call

Attributes added to a notice error call on the New Relic API. Defaults:

  • Transaction traces: Unavailable
  • Error collector (traced errors): Enabled
  • Transaction events: Unavailable
  • Page views (browser monitoring): Unavailable
request.headers.referer

The optional request header referer. Defaults:

  • Transaction traces: Enabled
  • Error collector (traced errors): Enabled
  • Transaction events: Disabled
  • Page views (browser monitoring): Unavailable
request.parameters.*

Request parameters from the transaction. The Java agent captures GET parameters by default. In order to capture POST parameters, use the addCustomParameter API call.

The capture_params property has been deprecated. However, if set to true, it will enable request parameters for transaction traces and traced errors. Defaults:

  • Transaction traces: Disabled
  • Error collector (traced errors): Disabled
  • Transaction events: Disabled
  • Page views (browser monitoring): Unavailable

Collecting user attributes

You can also use attributes to automatically forward user information to Insights. For more information, see Collecting Java user attributes.

Upgrading the Java agent

When upgrading to Java agent 3.7.0 or higher, upgrade your newrelic.yml configuration file. For more information about deprecated properties, see Enabling and disabling attributes.

Customizing via XML

You can also set custom attributes for your Java app via XML:

For more help

Additional documentation resources include:

Join the discussion about Java monitoring 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.