Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix exception thrown using the Symfony profiler for Messenger workers #24 #25

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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
3 participants