PHP SDK 2.0 setTag but no setTags

Hey there.

I see that Scope object appears to allow you to set a single tag name/value pair, but, if you have multiple tag name/value pairs to set, it’s somewhat messy/verbose.

why not add support for:

setTags(array);

where:
array is an associative array (key/value collection)?

so that multiple can be set with:

setTags([
‘item1’ => ‘value1’,
‘item2’ => ‘value2’,
‘item3’ => ‘value3’,
]);

or, where the tags are built up into a collection array already:

setTags($tags);

?

We will add this! Thanks for the feedback!

1 Like

PHP function setTag seems added in 2.0 version, regarding to sentry-php/UPGRADE-2.0.md at 1b4acb089c63246d1a6f074e4b5ebcfe80be2057 · getsentry/sentry-php · GitHub - that’s good!

…but removed in 3.0 version, regarding to sentry-php/UPGRADE-3.0.md at 1b4acb089c63246d1a6f074e4b5ebcfe80be2057 · getsentry/sentry-php · GitHub? :confused:

Can anybody describe why?

And in documentation here Customize Tags for PHP | Sentry Documentation we still see example with setTag(), which is not available already…