Add custom attributes to your New Relic data

Add metadata for more detailed analysis

There are countless filters and pivots you may want to apply to your data. By adding custom attributes to your data, you can see beyond your code and analyze your business in-depth.

You can add a 'userid' custom attribute to your APM-reported data (Transaction and TransactionError events) with the Java APM agent's API.

NewRelic.addCustomParameter("userid", userId);

Once added, you can run a NRQL query that uses the 'userid' custom attribute.

-- Get a count of errors experienced by a single filtered userid faceted by date and error message
SELECT count(*) FROM TransactionError WHERE userid = '616e6472-6577-7340-7961-686f6f2e636f' FACET dateOf(timestamp), `error.message` SINCE 1 week ago

Once you have added a custom attribute like 'userid', you can use it to filter and facet your NRQL queries. 

uc2-sec1-examplequery