This bundle provides an enhanced interaction with NewRelic from within a Symfony environment, ensuring optimal monitoring and logging for your applications.
traceId. The bundle also provides batching for optimal performance, configurable via the logging.buffer_size.HttpExceptions.To install the CHECK24 New Relic bundle, use composer:
composer require check24-cp/newrelic-bundle
After installing the bundle, you need to configure it to suit your application's needs. Here's a detailed explanation of each configuration option based on the provided extension:
ini_get('newrelic.appname').ini_get('newrelic.license').false.check24.new_relic.interactor.check24.new_relic.transaction_name.messenger.message_name.check24.new_relic.transaction_name.request.route_name.check24.new_relic.trace_id.uuid_factory.Here's a basic example of how you might configure the bundle using Symfony's yaml:
check24_new_relic:
appname: "My Symfony App"
license: "YOUR_NEWRELIC_LICENSE_KEY"
xmit: false
interactor: 'custom.new_relic.interactor'
logging:
buffer_size: 200
transaction_naming:
messenger: 'custom.transaction_name.messenger'
request: 'custom.transaction_name.request'
excluded_transactions:
commands:
- 'app:exclude-this-command'
routes:
- 'exclude_route_name'
paths:
- '/exclude-this-path'
excluded_exceptions:
- 'Symfony\Component\HttpKernel\Exception\NotFoundHttpException'
trace_id_factory: 'custom.trace_id.factory'
when@dev:
check24_new_relic:
# This is useful to be able to get logs about different NewRelic events in Symfony's profiler
interactor: 'check24.new_relic.logging_interactor'
Adjust the values as per your requirements. Ensure you replace placeholders like YOUR_NEWRELIC_LICENSE_KEY with actual values.
One of the standout features of this bundle is the ability to seamlessly integrate logging with NewRelic,
linking them via a trace.id. This ensures you have all the necessary context when diagnosing issues, as you can see related
logs in NewRelic that correspond to a particular request or process.
It eliminates the disconnect often seen when logs and monitoring are handled separately.
In times of issues or outages, having this cohesive view can be invaluable,
allowing for rapid diagnosis and resolution.
To harness this logging integration, you need to configure your monolog
settings specifically to support the NewRelicHandler provided by this bundle.
Update your config/packages/monolog.yaml with the following configuration:
monolog:
handlers:
main:
type: fingers_crossed
action_level: error
handler: nested
excluded_http_codes:
- 404
- 405
channels: ['!event']
nested:
type: service
id: 'check24.new_relic.monolog_handler'
To be able to track messages received with Messenger, you need to update
config/packages/messenger with the following configuration:
framework:
messenger:
buses:
default:
middleware:
- check24.new_relic.messenger_middleware
Now the bundle should be able to report each consumed message as a separate transaction, using the message name (see Configuration/Transaction Naming section) as the transaction name.
How can I help you explore Laravel packages today?