New Relic collects and reports information on web transactions and non-web transactions, such as background tasks. New Relic normally produces complete information automatically, without any need to modify your application code. However, if you are not using a supported framework, you may need to add custom instrumentation.
Custom instrumentation is also useful to:
- Add detail to your transaction traces.
- Block instrumentation on selected transactions you do not want instrumented.
- Instrument a part of your code that New Relic simply is not picking up.
Do not use brackets
[suffix] at the end of your transaction name. New Relic automatically strips brackets from the name. Instead, use parentheses
(suffix) or other symbols if needed.
When to use custom instrumentation
Custom instrumentation allows you to track interactions that are not captured by New Relic's automatic instrumentation. Custom instrumentation can also add detail to your transaction traces, to help you identify key issues.
New Relic collects data from many frameworks automatically. If you are using a supported framework, you should not need custom instrumentation to collect metric timeslices, events, and traces.
However, if you encounter any of these situations, you may need custom instrumentation:
- Transactions do not appear in the UI.
- Transaction traces include large blocks of application code time without full detail.
Implement custom instrumentation
Each agent implements custom instrumentation differently:
A metric grouping issue occurs when an account sends too many differently-named metric timeslices to New Relic, and those individual web transactions are not properly aggregated. For example, rather than a single
/user/controlpanel/ metric name, you might see
Custom instrumentation can cause metric grouping issues if you introduce too many uniquely-named metric timeslices that New Relic cannot effectively group. If you send thousands of metrics, New Relic may apply rules to reduce the number of transactions.