As New Relic monitors your application, we record each transaction as an event. As part of this monitoring, we’re able to capture attributes that are associated with each event. For example, when a user requests a page, we call the request a PageView and can record attributes specific to that request, such as the user’s username, as an attribute associated with that PageView.
Wouldn’t it be nice to have a powerful, flexible, and consistent way to configure which attributes should be sent to New Relic for different types of events? We are happy to announce a new configuration system that provides exactly that. Starting with New Relic Java Agent 3.7 and PHP Agent 4.9 you can use the same attribute configuration for both agents and soon you’ll be able to use it with the .NET, Node.js, Python, and Ruby agents as well as the Agent SDK (beta).
The configuration works by enabling attribute delivery for specific New Relic product destinations such as New Relic APM’s transaction traces and traced errors and New Relic Insights’ transaction and pageview events. Specific attributes can be included or excluded by attribute name for all of these destinations at once, or specific destinations, based on both exact and wildcard matching.
Here’s an example to give you a sense of what the new configuration can do. Imagine that you have two sets of user attributes, one of which you don’t want to send to New Relic. You can configure New Relic’s agents to ignore any user attributes that are not explicitly included in the configuration. Given this configuration:
# Enable attribute collection in browser monitoring
# Exclude any attribute from all types of events if their names start with “user” and aren’t explicitly included
# Explicitly include all attributes with names starting with “user.info.” in all types of events
# For transaction traces, exclude attributes named “user.info.name”
and these names for event attributes:
user, user.private, user.info.name, user.info.id
the names (and values) sent to each New Relic destination are:
error_collector: user.info.name, user.info.id
transaction_events: user.info.name, user.info.id
browser_monitoring: user.info.name, user.info.id
In other words, user.info.name will only be excluded from transaction traces. user and user.private will be excluded from all destinations.
Updating your configuration
These attribute configuration improvements replace or rename several existing configuration options. The old options will continue to work as expected but have been deprecated so you’ll want to update your agent configuration to the new properties as soon as possible. The documentation includes an upgrade guide that maps old settings to new settings.
Please note that High Security Mode overrides these agent attribute settings by preventing all HTTP parameters, message queue parameters, and user attributes from being sent by the agent.