vrtak-cz/newrelic-nette

NewRelic PHP agent integration for Nette Framework

Installs: 2 625

Dependents: 0

Stars: 18

Watchers: 6

Forks: 6

Language: PHP

v5.0.0 2015-03-06 14:27 UTC

README

Build Status Latest Stable Version Composer Downloads Dependency Status

Requirements

  • Nette >=2.2.0 (2.2.x support will be removed on 31 Jan 2016)
  • PHP >=5.4.0 (5.4.x support will be removed on 14 Sep 2015)

Installation

composer require vrtak-cz/newrelic-nette

edit app/config/config.neon

extensions:
    newrelic: VrtakCZ\NewRelic\Nette\Extension

Config

newrelic:
    enabled: Yes #default
    ratio: 1
    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
        ratio: 1
    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

Realtime User Monitoring

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}

License

NewRelic Nette is licensed under the MIT License - see the LICENSE file for details