msstc4symfony / profiling-bridge-logic
Opens a msstc4symfony/profiling-bundle span around every msstc4symfony/logic-bundle Action
Package info
github.com/msstc4symfony/profiling-bridge-logic
Type:symfony-bundle
pkg:composer/msstc4symfony/profiling-bridge-logic
Requires
- php: >=8.2
- composer-runtime-api: >=2.2
- msstc4symfony/logic-bundle: ^1.3|^2.0
- msstc4symfony/profiling-bundle: ^2.0
- symfony/config: ^7.4|^8.0
- symfony/dependency-injection: ^7.4|^8.0
- symfony/http-kernel: ^7.4|^8.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.76
- phpstan/extension-installer: ^1.4
- phpstan/phpstan: ^2.1
- phpstan/phpstan-strict-rules: ^2.0
- phpstan/phpstan-symfony: ^2.0
- phpunit/phpunit: >=11.0
- psr/log: ^3.0
- rector/rector: ^2.1
- roave/security-advisories: dev-latest
- symfony/filesystem: ^7.4|^8.0
- symfony/framework-bundle: ^7.4|^8.0
- symfony/monolog-bundle: ^3.11|^4.0
- symfony/validator: ^7.4|^8.0
Suggests
None
Provides
None
Conflicts
Replaces
None
README
Opens a profiling-bundle span around every logic-bundle Action run, so Actions show up in the span tree of the request, command or message that called them.
Compatibility
| Bundle | PHP | Symfony | logic-bundle | profiling-bundle |
|---|---|---|---|---|
| 2.0 | 8.2+ | 7.4, 8.x | ^1.3, ^2.0 | ^2.0 |
| 1.1 | 8.2+ | 7.4, 8.x | ^1.2 | ^1.1 |
| 1.0 | 8.4+ | 7.4, 8.x | ^1.1 | ^1.0 |
Symfony 8.x needs PHP 8.4; on PHP 8.2 and 8.3 Composer installs Symfony 7.4.
Installation
composer require msstc4symfony/profiling-bridge-logic
Register the bridge in config/bundles.php alongside the two bundles it connects (order does not matter):
Msstc4Symfony\ProfilingBundle\ProfilingBundle::class => ['all' => true], Msstc4Symfony\LogicBundle\LogicBundle::class => ['all' => true], Msstc4Symfony\ProfilingBridgeLogic\ProfilingBridgeLogicBundle::class => ['all' => true],
Nothing to configure. Without ProfilingBundle the container fails to compile: ProfilingMiddleware cannot be
autowired, as no ProfilingFactoryInterface service exists.
The span
- Message:
action <name>, where<name>is the name logic-bundle uses in its logs (ActionNameResolver): the Action class, unless anActionNameBuilderInterfaceservice supports it. A name builder that throws falls back to the Action class instead of failing the Action. - End context:
outcome—success,expected_failureorerror, as logic-bundle'sActionOutcomeclassifies the exception — plusexception(itsget_debug_type(), soDomainException@anonymousfor an anonymous class) when the Action threw. - An Action called from another Action gets a child span of the caller's span.
- The exception is always rethrown unchanged; profiling-bundle logs failures of its own processors instead of throwing them.
The bridge is an Action middleware at priority 500, the outermost one: the span also covers metrics-bridge-logic (400), logging (300), validation (200) and lock (100).
Select Action spans by their prefix with profiling-bundle's span lists, for example to skip health checks:
msstc4symfony_profiling: spans: blacklist: ['action App\Application\Health']
With metrics-bridge-profiling these spans also become
observations of symfony_profiling_span_duration_histogram_seconds.
Public API
Only the bundle class Msstc4Symfony\ProfilingBridgeLogic\ProfilingBridgeLogicBundle; the middleware is @internal
and is wired by the bundle.
Local development
composer-ci.json installs logic-bundle and profiling-bundle.
make install-ci # composer-ci.json profile with every CI tool COMPOSER=composer-ci.json make check # lint, PHPStan, CS, composer validate/audit, Rector, deptrac make test # unit + integration
License
MIT — see LICENSE.