stikmanw / silex-newrelic
Integrate the NewRelic PHP API into Silex framework
This package's canonical repository appears to be gone and the package has been frozen as a result.
Installs: 14 693
Dependents: 1
Suggesters: 0
Security: 0
Stars: 19
Watchers: 2
Forks: 4
Open Issues: 0
Requires
- php: >=5.3.0
- intouch/newrelic: ~1.0
- silex/silex: ~1.0
Requires (Dev)
- mockery/mockery: 0.8.0
- phpunit/phpunit: 3.7.*
This package is not auto-updated.
Last update: 2023-03-04 09:01:18 UTC
README
Integrate the NewRelic PHP Agent API into Silex framework.
Acknowledgement
This was originally created by mcuadros. credit goes to him for his hardwork.
Requirements
- PHP 5.3.x
- intouch/newrelic
- newrelic >= 3.1
Versions
This project recently changed hands. See the below updated verions for information on how to require correct dependency.
- v0.1.0 - Original Repo state used ini settings supported by older versions of NewRelic PHP Agent
- v1.0.0 - Removed ini settings and replaced with more direct hooks into Intouch/NewRelic library
Installation
The recommended way to install NewRelic/Silex is through composer. You can see the package information on Packagist.
Run composer require
to get the latest version:
composer require stikmanw/silex-newrelic
Methods
newrelic.custom_parameter
( string $key, $value ): Assign a custom parameter to be captured for the request by NewRelic Agent. Details: NewRelic custom_parameternewrelic.custom_metric
(string $name, mixed $value): Assign a metric name and value to be captured by NewRelic Agent. Details: NewRelic custom_metric
Parameters
Set all parameters in the array $app['newrelic.options']:
application_name
(default 'Silex PHP Application'): Sets the name of the application to name.transaction_name_method
(default 'uri'): if 'uri' the request URI will be used as transaction name, if 'route' will be used the alias name from the route.transaction_tracer_detail
(default 1): check it at newrelic.transaction_tracer.detail not supported 1.0.0capture_params
(default false): determine if the request should capture parameters specified by NewRelic docs. newrelic.capture_paramsignored_params
(default ''): check it at newrelic.ignored_params not supported 1.0.0disable_auto_rum
(default false): Prevents the output filter from attempting to insert RUM JavaScript for this current transaction. Useful for AJAX calls, for example.ignored_transaction
(default false): do not send the transaction for tracking to the agent. added 1.0.0 newrelic.ignored_paramscustom_params
(default array()):list of custom params to assign to the request, see custom_params method above. added 1.0.0custom_metrics
(default array()): custom metrics to setup when the provider is registered, see custom_metrics method above. added 1.0.0
Registering
$app->register(new NewRelic\Silex\NewRelicServiceProvider()); $app['newrelic.options'] = array( 'application_name' => 'Example PHP Application', 'transaction_name_method' => 'route' );
Tests
Tests are in the tests
folder.
To run them, you need PHPUnit.
Example:
$ phpunit --configuration phpunit.xml.dist
License
MIT, see LICENSE