Search by

msstc4symfony / profiling-bridge-logic

maxim.shamaev@gmail.com

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

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v2.0.1 2026-10-23 08:38 UTC

This package is auto-updated.

Last update: 2026-12-04 07:01:25 UTC


README

Build Status License: MIT

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 an ActionNameBuilderInterface service supports it. A name builder that throws falls back to the Action class instead of failing the Action.
  • End context: outcome — success, expected_failure or error, as logic-bundle's ActionOutcome classifies the exception — plus exception (its get_debug_type(), so DomainException@anonymous for 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.