aeatech/web-snapshot-profiler-newrelic-bundle
Symfony bundle that integrates Web Snapshot Profiler with New Relic for production-grade request profiling. Configure app name/license and enable profiling selectively per route via headers, request params with probabilities, or profile all routes. Requires PHP 8.2+ and ext-newrelic.
The package contains symfony bundle to profile web applications with newrelic. It can be used for production profiling.
System requirements:
Installation (Composer):
composer require aeatech/web-snapshot-profiler-newrelic-bundle
You can install it with custom recipe.
composer config extra.symfony.allow-contrib true
composer config --json --merge extra.symfony.endpoint '["https://api.github.com/repos/AEATech/recipes/contents/index.json?ref=main", "flex://defaults"]'
composer require aeatech/web-snapshot-profiler-newrelic-bundle
Enable bundle in dev and prod env.
// config/bundles.php
return [
// ...
AEATech\WebSnapshotProfilerNewrelicBundle\AEATechWebSnapshotProfilerNewrelicBundle::class => ['dev' => true, 'prod' => true],
// ...
];
Symfony Flex generates a default configuration in config/packages/aea_tech_web_snapshot_profiler_newrelic.yaml
aea_tech_web_snapshot_profiler_newrelic:
# Enable/Disable profiling
is_profiling_enabled: false
# newrelic configuration
newrelic:
app_name: '%env(string:AEA_TECH_WEB_SNAPSHOT_PROFILER_NEWRELIC_APP_NAME)%'
license: '%env(string:AEA_TECH_WEB_SNAPSHOT_PROFILER_NEWRELIC_LICENSE)%'
###
# Event matched configuration - START
###
event_matcher:
# Enable/Disable all routes profiling
is_profile_all_routes: false
# Enable profile if header was set (\AEATech\WebSnapshotProfilerEventSubscriber\EventMatcher\HeaderEventMatcher)
header:
is_enabled: false
name: 'x-profiling-header'
value: '1'
# Enable profile if request param was set and route matched (\AEATech\WebSnapshotProfilerEventSubscriber\EventMatcher\RequestParamAwareRouteEventMatcher)
request:
is_enabled: false
name: 'x-profile-request-param'
route_to_probability:
# 1% probability to profile route
-
route_name: 'app_route_name_1'
probability: 1
# 100% probability to profile route
-
route_name: 'app_route_name_2'
probability: 100
# Enabled profile if route matched and probability happened
route:
is_enabled: false
route_to_probability:
# 1% probability to profile route
-
route_name: 'app_route_name_1'
probability: 1
# 100% probability to profile route
-
route_name: 'app_route_name_2'
probability: 100
###
# Event matched configuration - END
###
MIT License. See LICENSE for details.
How can I help you explore Laravel packages today?