Keep command tag after console has finished running#1033
Conversation
|
You can also run commands from inside requests I believe which fire the same events, there we don't want to keep the tag. I see what you mean though and we should fix this but simply always leaving the tag might not be the solution here. |
|
I had a look into the available console events in Laravel and it seems like we could utilize the
My idea is as follows:
Or we choose a completely different approach, that doesn't use the
What do you think, @stayallive? |
Description
Deletes the
->removeTag('command')call in theCommandFinishedevent handler.Reasoning
Many of our Sentry events show
--for thecommandtag, even though they are coming from a command execution. Thecommandis only present when->captureMessage()or->captureException()was used, or when the error is caused by PHP itself (e.g.Undefined array key "foo").When manually throwing errors with
throw new ...in the code, theCommandFinishedevent seems to be still fired at the end, and thus thecommandtag is deleted.I see no reason why the
commandtag shouldn't remain in the payload that is sent to Sentry.