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
add symfony default tags #116
add symfony default tags #116
Conversation
add tags.symfony_version to the current symfony version add tags.symfony_app_env the symfony env currently in use
Hi there, and thanks for the contribution! You should know though that the Symfony environment by default is already sent to Sentry using the configuration key ``, see here:
Also, you should simplify the |
@Jean85 feedback addressed. ohhh - you are right about the env, somehow in our production system wie set let me know if you need me to change anything else. |
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 fast response! I just need to check on one last thing...
src/SentrySymfonyClient.php
Outdated
$default_tags = [ | ||
'symfony_version' => \Symfony\Component\HttpKernel\Kernel::VERSION, | ||
]; | ||
$options['tags'] = $options['tags'] ?? []; |
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.
Umh, I don't understand why you need to do those two lines. Isn't $options['tags']['symfony_version'] = ...
just enough?
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.
- when no tags set, be sure to have atleast an empty array (to be ok, later on with
array_merge
). - merge user provided tags with default tags.
i am quite confident that it works, but open for alternative suggestions.
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.
$options['tags']['symfony_version'] =
- might fail if tags
is not an array/key
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.
The var is initialized as array $options = []
so it's an array for sure, worst case an empty one.
Since it's an array, setting directly $options['tags']['symfony_version']
will never fail, so merging is unnecessary.
@Jean85 ok now i got you 👍 sorry for me being that dumb, and many thx for patience and guidance. 🍻 |
Don't worry, thank you for your patience! |
Can I ask you to backport this PR to the 1.x branch? |
@Jean85 sure will submit a seperate PR |
* backport #116 to 1.x * cs fix
(cherry picked from commit d68d99e)
adds
symfony_version
andsymfony_app_env
tags, per default.