In-Touch / laravel-newrelic

Laravel NewRelic ServiceProvider
173 stars 48 forks source link

Change the default newrelic.name_provider #45

Open Jalle19 opened 7 years ago

Jalle19 commented 7 years ago

This is a better practice, the previous default was explicitly recommended against in New Relic's documentation:

You have /product/123 and /product/234. If you generate a separate transaction name for each, then New Relic will store separate information for these two transaction names.

Instead, store the transaction as /product/*, or use something significant about the code itself to name the transaction, such as /Product/view. The total number of unique transaction names should be less than 1000. Exceeding that is not recommended.

In MVC frameworks, one good option is to use the newrelic_name_transaction() call where your request is routed and name your transaction with a format of Controller / Action.

Unique values like URLs, Page Titles, Hex Values, Session IDs and uniquely identifiable values should not be used in naming your transactions, but instead tagged to the transaction as a custom parameter. See newrelic_add_custom_parameter() API function.

Jalle19 commented 7 years ago

Fixes https://github.com/In-Touch/laravel-newrelic/issues/34 too