NewRelic PHP agent integration for Nette Framework
Build Status Latest Stable Version Composer Downloads Dependency Status
- Nette >=2.3.0 (2.3.x support will be removed on 31 Jan 2017)
- PHP >=5.5.0 (5.5.x support will be removed on 10 Jul 2016)
composer require vrtak-cz/newrelic-nette
edit app/config/config.neon
extensions: newrelic: VrtakCZ\NewRelic\Nette\Extension
newrelic: enabled: Yes #default appName: YourApplicationName #optional license: yourLicenseCode #optional actionKey: action # default - optional - action parameter name logLevel: #defaults - critical - exception - error # optional options with default values rum: enabled: auto # other options are Yes/No transactionTracer: enabled: Yes detail: 1 recordSql: obfuscated slowSql: Yes threshold: apdex_f stackTraceThreshold: 500 explainThreshold: 500 errorCollector: enabled: Yes recordDatabaseErrors: Yes parameters: capture: No ignored: [] customParameters: paramName: paramValue
add this component factory to your base presenter
protected function createComponentNewRelicHeader() { $control = $this->context->getService('newrelic.rum')->headerControl; $control->disableScriptTag(); // optionall return $control; } protected function createComponentNewRelicFooter() { $control = $this->context->getService('newrelic.rum')->footerControl; $control->disableScriptTag(); // optionall return $control; }
and add this to your @layout header (before </head>)
{control newRelicHeader}and add this to your @layout footer (before </body>)
{control newRelicFooter}NewRelic Nette is licensed under the MIT License - see the LICENSE file for details