Skip to content

fix(flow-php/symfony-telemetry-bundle): stop calling Router::getRouteCollection() on every request - #2525

Merged
norberttech merged 1 commit into
1.xfrom
telemetry-url-path-span-bug
Jul 11, 2026
Merged

fix(flow-php/symfony-telemetry-bundle): stop calling Router::getRouteCollection() on every request#2525
norberttech merged 1 commit into
1.xfrom
telemetry-url-path-span-bug

Conversation

@norberttech

@norberttech norberttech commented Jul 11, 2026

Copy link
Copy Markdown
Member

Change Log


Added

  • flow-php/symfony-telemetry-bundle - RouteNamePathMap optional cache warmer building a [route name => path] map at cache:warmup, rebuilt lazily when missing

Fixed

  • flow-php/symfony-telemetry-bundle - route_naming: path no longer calls Router::getRouteCollection() (full route collection rebuild) on every traced request

Changed

  • flow-php/symfony-telemetry-bundle - HttpKernelSpanSubscriber constructor takes ?RouteNamePathMap instead of ?RouterInterface

Removed

Deprecated

Security


@bendavies I think this should work. Basically during cache:warmup it generates a flat map of route_name => route_path so the Telemetry Subscriber doesn't even need to touch router.
If the map wasn't generated it will fallback to route_name only.

…Collection() on every request with route_naming: pat

- add RouteNamePathMap: ConfigCache-backed [route name => path] map,
warmed at cache:warmup (optional warmer) or lazily on first use
- HttpKernelSpanSubscriber takes ?RouteNamePathMap instead of
?RouterInterface; routeValue() is an O(1) lookup
- degrade to route-name naming (never touch the router at runtime) when
the map cannot be built
@norberttech norberttech added the hackaton-07-2026 A first Flow Hackaton with Stloyd and MrHDOLEK 🎉 label Jul 11, 2026
@norberttech norberttech added this to the 0.42.0 milestone Jul 11, 2026
@codecov

codecov Bot commented Jul 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.27%. Comparing base (53065fd) to head (cb66d2d).
⚠️ Report is 3 commits behind head on 1.x.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff              @@
##                1.x    #2525      +/-   ##
============================================
- Coverage     86.27%   86.27%   -0.01%     
- Complexity    22924    22939      +15     
============================================
  Files          1739     1740       +1     
  Lines         70415    70460      +45     
============================================
+ Hits          60753    60789      +36     
- Misses         9662     9671       +9     
Components Coverage Δ
etl 89.86% <ø> (ø)
cli 89.40% <ø> (ø)
lib-array-dot 81.44% <ø> (ø)
lib-azure-sdk 64.44% <ø> (ø)
lib-doctrine-dbal-bulk 93.61% <ø> (ø)
lib-filesystem 86.04% <ø> (ø)
lib-types 90.18% <ø> (ø)
lib-parquet 70.10% <ø> (ø)
lib-parquet-viewer 82.26% <ø> (ø)
lib-snappy 90.26% <ø> (+0.88%) ⬆️
lib-dremel 0.00% <ø> (ø)
lib-postgresql 88.62% <ø> (ø)
lib-telemetry 86.58% <ø> (ø)
bridge-filesystem-async-aws 92.74% <ø> (ø)
bridge-filesystem-azure 90.45% <ø> (ø)
bridge-monolog-http 96.82% <ø> (ø)
bridge-monolog-telemetry 94.79% <ø> (ø)
bridge-openapi-specification 92.07% <ø> (ø)
symfony-http-foundation 78.57% <ø> (ø)
bridge-psr18-telemetry 100.00% <ø> (ø)
bridge-psr3-telemetry 98.95% <ø> (ø)
bridge-psr7-telemetry 100.00% <ø> (ø)
bridge-telemetry-otlp 90.41% <ø> (ø)
bridge-symfony-http-foundation-telemetry 92.85% <ø> (ø)
bridge-symfony-filesystem-bundle 90.66% <ø> (ø)
bridge-symfony-filesystem-cache 98.18% <ø> (ø)
bridge-symfony-postgresql-bundle 93.39% <ø> (ø)
bridge-symfony-postgresql-cache 94.41% <ø> (ø)
bridge-symfony-postgresql-messenger 98.80% <ø> (ø)
bridge-symfony-postgresql-session 93.65% <ø> (ø)
bridge-symfony-telemetry-bundle 90.10% <75.00%> (-0.14%) ⬇️
adapter-chartjs 84.05% <ø> (ø)
adapter-csv 91.66% <ø> (ø)
adapter-doctrine 90.79% <ø> (ø)
adapter-google-sheet 99.18% <ø> (ø)
adapter-http 72.34% <ø> (ø)
adapter-json 88.71% <ø> (ø)
adapter-logger 50.00% <ø> (ø)
adapter-parquet 77.70% <ø> (ø)
adapter-text 74.13% <ø> (ø)
adapter-xml 83.40% <ø> (ø)
adapter-avro 0.00% <ø> (ø)
adapter-excel 94.21% <ø> (ø)
adapter-postgresql 91.06% <ø> (ø)
adapter-seal 85.42% <ø> (ø)
bridge-phpunit-postgresql 75.30% <ø> (ø)
bridge-phpunit-telemetry 87.32% <ø> (ø)
bridge-phpstan-types 0.00% <ø> (ø)
bridge-postgresql-valinor 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bendavies bendavies left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lovely

@norberttech
norberttech merged commit 5807825 into 1.x Jul 11, 2026
47 of 48 checks passed
@norberttech
norberttech deleted the telemetry-url-path-span-bug branch July 11, 2026 18:22
@github-project-automation github-project-automation Bot moved this from Todo to Done in Roadmap Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hackaton-07-2026 A first Flow Hackaton with Stloyd and MrHDOLEK 🎉 size: M

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants