Skip to content

Conversation

@adrienbrault
Copy link
Collaborator

@adrienbrault adrienbrault commented Feb 18, 2025

Fixes #24

Fix exception thrown using the Symfony profiler for Messenger workers

  • Replace backslashes with regular slashes in the transaction name in src/EventListener/MessengerProfilerListener.php
    • Use str_replace('\\', '/', \get_class($event->getEnvelope()->getMessage()))
  • Replace backslashes with regular slashes in the transaction name in src/Messenger/ProfilerMiddleware.php
    • Use str_replace('\\', '/', \get_class($envelope->getMessage()))
  • Ensure the transaction name is used in the URI with regular slashes in src/Profiler/SymfonyProfiler.php
    • Replace backslashes with regular slashes in the URI

For more details, open the Copilot Workspace session.

…24

Fixes #24

Fix exception thrown using the Symfony profiler for Messenger workers

* Replace backslashes with regular slashes in the transaction name in `src/EventListener/MessengerProfilerListener.php`
  * Use `str_replace('\\', '/', \get_class($event->getEnvelope()->getMessage()))`
* Replace backslashes with regular slashes in the transaction name in `src/Messenger/ProfilerMiddleware.php`
  * Use `str_replace('\\', '/', \get_class($envelope->getMessage()))`
* Ensure the transaction name is used in the URI with regular slashes in `src/Profiler/SymfonyProfiler.php`
  * Replace backslashes with regular slashes in the URI

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/sourceability/instrumentation/issues/24?shareId=XXXX-XXXX-XXXX-XXXX).
Copy link

@dev-cld dev-cld left a comment

Choose a reason for hiding this comment

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

The modification in SymfonyProfiler.php seems sufficient, making the other two changes redundant.

@magikid
Copy link
Member

magikid commented Feb 18, 2025

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exception thrown using the Symfony profiler for Messenger workers

4 participants