New Relic collects and reports information on web browser transactions and background tasks. New Relic normally produces complete information right out of the box without any need to modify your application code. However, if New Relic does not support your framework, you may need to add custom instrumentation.
Custom instrumentation is also useful to add detail to your transaction traces, to block instrumentation on transactions you don't want instrumented, or if New Relic is simply not picking up a part of your code that you want to instrument.
For maximum visibility into your application, ensure that the
newrelic.transaction_tracer.detail parameter is set to 1 (default). This will cause all PHP functions to be timed, thus reducing greatly the amount of "uninstrumented time" in a transaction trace. Over and above that setting, the following API calls can be used to control transactions and add custom instrumentation:
Include a conditional check for the New Relic agent so that your code will work with or without the agent present.
For more help
Additional documentation resources include:
- Custom instrumentation (Overview of custom instrumentation)
- Collect custom metrics with newrelic_custom_metric (Use an API call to record arbitrary metrics)