protected function configureNewRelic(Application $app)
    {
        if (
            isset($app['newrelic.options']['application_name']) &&
            $app['newrelic.options']['application_name']
        ) {
            $app['newrelic']->setAppName($app['newrelic.options']['application_name']);
        }

        /**
         * @see https://docs.newrelic.com/docs/agents/php-agent/configuration/php-agent-api#api-rum-disable
         */
        if (
            isset($app['newrelic.options']['disable_auto_rum']) &&
            $app['newrelic.options']['disable_auto_rum']
        ) {
            $app['newrelic']->disableAutoRUM();
        }

        /**
         * @see https://docs.newrelic.com/docs/agents/php-agent/configuration/php-agent-api#api-capture-params
         */
        if (
            isset($app['newrelic.options']['capture_params']) &&
            $app['newrelic.options']['capture_params']
        ) {
            $app['newrelic']->captureParams($app['newrelic.options']['capture_params']);
        }

        /**
         * @see https://docs.newrelic.com/docs/agents/php-agent/configuration/php-agent-api#api-ignore-transaction
         */
        if (
            isset($app['newrelic.options']['ignore_transactions']) &&
            $app['newrelic.options']['ignore_transaction']
        ) {
            $app['newrelic']->ignoreTransaction();
        }

        if (
            isset($app['newrelic.options']['custom_metrics']) &&
            is_array($app['newrelic.options']['custom_metrics'])
        ) {

            foreach($app['newrelic.options']['custom_metrics'] as $name => $value) {
                $app['newrelic.custom_metric']($name, $value);
            }

        }

        if (
            isset($app['newrelic.options']['custom_params']) &&
            is_array($app['newrelic.options']['custom_params'])
        ) {

            foreach($app['newrelic.options']['custom_params'] as $name => $value) {
                $app['newrelic.custom_params']($name, $value);
            }

        }

    }