PHP custom instrumentation

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.

Ensure all PHP functions are timed

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.

Use the agent API to control transactions

Beyond that setting, agent API calls can control transactions and add custom instrumentation:

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.