1- #Laravel NewRelic package
2-
3- ### Note
4-
5- ** ` master ` is currently undergoing updates to support Laravel 5**
6-
7- For **Laravel 4.1/4.2** support, please use the latest 1.1.x tag.
8- For **Laravel 4.0** support, please use the latest 1.0.x tag. Laravel 4.0 support is deprecated and will not be
9- updated.
1+ # Laravel 5 NewRelic Service Provider
2+ * see below for Laravel 4.x support*
103
114### Installation
125
136Using ` composer ` , run:
147
15- composer require intouch/laravel-newrelic:dev-master
8+ composer require intouch/laravel-newrelic:"~2.0"
169
1710Or add ` intouch/laravel-newrelic ` to your composer requirements:
1811
1912 "require": {
20- "intouch/laravel-newrelic": "dev-master "
13+ "intouch/laravel-newrelic": "~2.0 "
2114 }
2215
2316... and then run ` composer install `
@@ -67,27 +60,34 @@ Both observers take two optional parameters to their constructors: `$name` and `
6760to give to your custom metric, and if unset will default to the class name of the model object it is observing. If you
6861want to change the ` $care ` array without changing the naming, simply pass ` null ` as the first constructor argument.
6962
70- ` $care ` is an array of event names you want to care about. This differs slightly between the ___ Counting ___ and
71- ___ Timing ___ observers. For the ___ Counting ___ observer, any event can be counted independently. For the ___ Timing ___
63+ ` $care ` is an array of event names you want to care about. This differs slightly between the * Counting * and
64+ * Timing * observers. For the * Counting * observer, any event can be counted independently. For the * Timing *
7265observer, it uses the difference in time between ` saving ` and ` saved ` to submit the metric, so only the after-operation
7366events can be observed: ` created ` , ` saved ` , ` updated ` , ` deleted ` , ` restored ` . This is also why custom observable events
74- are not supported for the ___ Timing ___ observer (yet ... working on it, we're happy to take PRs).
67+ are not supported for the * Timing * observer (yet ... working on it, we're happy to take PRs).
7568
76- Per NewRelic's "best practice" suggestions, all metric names are prefaced with 'Custom/'. The ___ Counting ___ observer
77- also adds 'Counts/' to the name, while the ___ Timing ___ observer adds 'Timing/' to the name. Both observers append
78- the event name to the end of the metric name. Take as an example, using the ___ Counting ___ observer on the ` User ` model
69+ Per NewRelic's "best practice" suggestions, all metric names are prefaced with 'Custom/'. The * Counting * observer
70+ also adds 'Counts/' to the name, while the * Timing * observer adds 'Timing/' to the name. Both observers append
71+ the event name to the end of the metric name. Take as an example, using the * Counting * observer on the ` User ` model
7972monitoring the ` created ` event - the name would be: ` Custom/Counts/App/User/created ` (where ` App/User ` is the namespaced
80- class named of the observed model, or will be whatever you set in ` $name ` if supplied).
81-
82- ** NOTE:** To use the observers, the ` Newrelic ` Facade must be loaded in your application configuration, not just the
83- Service Provider.
73+ class name of the observed model with slashes reversed for NewRelic metric paths, or will be whatever you set in ` $name `
74+ if supplied).
8475
8576It is safe to run these observers in integration tests or interactive test environments as long as
8677` newrelic.throw_if_not_installed ` is set to ` false ` . Then if the NewRelic PHP Agent is not installed in that
87- environment, the custom metrics will simply not be recorded.
78+ environment, the custom metrics will simply not be recorded. If the NewRelic PHP Agent is installed in that
79+ environment, the metrics will be recorded.
8880
8981The default events both observers care about are: ` created ` , ` saved ` , ` updated ` , ` deleted ` , ` restored ` .
9082
83+ ** NOTE:** To use the observers, the ` Newrelic ` Facade must be loaded in your application configuration, not just the
84+ Service Provider.
85+
86+ ** NOTE:** NewRelic restricts the total number of custom metrics you can have to 2000, and recommends less than 1000.
87+
88+ #### Example Custom Metrics Dashboard
89+ ![ dashboard] ( dashboard.png )
90+
9191### Basic Use
9292
9393This package includes a Facade to the [ Intouch/Newrelic] ( http://github.com/In-Touch/newrelic ) class.
@@ -99,6 +99,16 @@ Any of its methods may be accessed as any other Facade is accessed, for example:
9999
100100... would set the NewRelic App Name to 'MyApp'
101101
102+ ### Laravel 4.x Support
103+
104+ | Laravel Version | Package Tag | Supported |
105+ | -----------------| -------------| -----------|
106+ | 4.2.x | [ 1.1.5] ( https://github.com/In-Touch/laravel-newrelic/tree/1.1.5 ) | yes |
107+ | 4.1.x | [ 1.1.5] ( https://github.com/In-Touch/laravel-newrelic/tree/1.1.5 ) | no |
108+ | 4.0.x | [ 1.0.4] ( https://github.com/In-Touch/laravel-newrelic/tree/1.0.4 ) | no |
109+ * we will review PRs for unsupported versions, but we don't use those versions in production ourselves so we aren't
110+ testing / working on that*
111+
102112### Issues
103113
104114Before opening an issues for data not reporting in the format you have configured, please check your NewRelic PHP Agent
0 commit comments