-
Notifications
You must be signed in to change notification settings - Fork 185
feat(breadcrumbs): add flag to reset breadcrumbs between messages #946
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
Conversation
@kkevindev within the next hour |
@@ -187,6 +187,7 @@ private function addMessengerSection(ArrayNodeDefinition $rootNode): void | |||
->{interface_exists(MessageBusInterface::class) ? 'canBeDisabled' : 'canBeEnabled'}() | |||
->children() | |||
->booleanNode('capture_soft_fails')->defaultTrue()->end() | |||
->booleanNode('isolate_breadcrumbs_by_message')->defaultFalse()->end() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd argue that having isolate_breadcrumbs_by_message
set to false
by default is correct for now as it otherwise would break bc, but should be deprecated right away as it should be true
by default in the future. The main argument is that messages (like requests) are handled separately already, and many of the services in the framework do already get reset on kernel.terminate
.
Maybe you can even rely on the Symfony\Contracts\Service\ResetInterface
in favor of the WorkerMessageReceivedEvent
that you are currently using?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion! I agree that it should be true
by default and we should do this in the next major.
I will also explore Symfony\Contracts\Service\ResetInterface
and see if we can use it here.
@kkevindev sorry to disappoint but we will release it tomorrow. I'll ping you once it's released |
@kkevindev happy to let you know that we just released this changes in |
This PR addresses the issue that breadcrumbs would "leak" into future messages.
We didn't create new scopes per message which meant that the breadcrumbs would just continue to grow and each message would contain breadcrumbs of all previous messages, which can be confusing when debugging.
We introduce a new option now to enable the breadcrumbs per message, which defaults to
false
as this was the previous behaviour and in some cases, breadcrumbs from previous messages might provide valuable insights.closes #672