Attribute examples

Here are some examples of using attributes with the New Relic PHP agent. To use these settings:

  1. Modify your newrelic.ini file as applicable.
  2. Restart the agent and its daemon for changes to take effect.

Disabling all attributes

In this example, attributes are disabled, so the include and exclude lists will be ignored and all attributes will be filtered out.

Configuration:

newrelic.attributes.enabled = false
newrelic.attributes.include = request.parameters.*

Input keys:

foo, bar, request.parameters.foo, request.parameters.bar

Output for destinations:

transaction_tracer: none
error_collector: none
transaction_events: none
browser_monitoring: none

Selecting specific destinations

In this example:

  • Attributes are disabled for transaction traces. The include and exclude lists will be ignored, and all attributes will be filtered out for this destination.
  • Attributes are also disabled for browser monitoring by default.
  • Request parameters (prefixed with request.parameters.) are off by default for all destinations.

As a result, only bar is sent in traced errors and transaction events.

Configuration:

newrelic.attributes.enabled = true
newrelic.transaction_tracer.attributes.enabled = false
newrelic.attributes.exclude = foo

Input keys:

foo, bar, request.parameters.foo, request.parameters.bar

Output for destinations:

transaction_tracer: none
error_collector: bar
transaction_events: bar
browser_monitoring: none

Selecting values and destinations

In this example, specific input keys are selected for certain output destinations and excluded from others.

  • The food.fruit.banana key will be excluded only from transaction traces.
  • The food and food.bread keys will be excluded from all destinations.

Configuration:

newrelic.browser_monitoring.attributes.enabled = true
newrelic.attributes.exclude = food*
newrelic.attributes.include = food.fruit.*
newrelic.transaction_tracer.attributes.exclude = food.fruit.banana

Input keys:

food, food.bread, food.fruit.banana, food.fruit.apple

Output for destinations:

transaction_tracer: food.fruit.apple
error_collector: food.fruit.banana, food.fruit.apple
transaction_events: food.fruit.banana, food.fruit.apple
browser_monitoring: food.fruit.banana, food.fruit.apple

For more help

Additional documentation resources include:

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