sentry-native icon indicating copy to clipboard operation
sentry-native copied to clipboard

Merge Tags when sending event

Open xamix opened this issue 4 years ago • 1 comments

Description

When I capture an event, I add some specific tags in the event. But when I capture the event, all the "globally settled tags" via sentry_set_tag are dropped

This is due to this line which replace the globals tags by the currently settled one: https://github.com/getsentry/sentry-native/blob/master/src/sentry_scope.c#L281

As the comment in code suggest, should the tags be merged? If it is the case then we cannot replace all tags anymore... Maybe a function should be added to add "volatile" tags only on the current event?

In the mean time how can I retrieve the originals globals tags and add it to my new tags object?

When does the problem happen

Each time I capture an event with specific key tags settled

  • [ ] During build
  • [X ] During run-time
  • [ ] When capturing a hard crash

Environment

WSL Linux Ubuntu 20.04 64bits

Steps To Reproduce

Call this line with new_tags containing others tags value and then capture event

sentry_value_set_by_key(event, "tags", new_tags);

xamix avatar May 11 '21 08:05 xamix

This is indeed a missing feature, yes.

Swatinem avatar May 12 '21 07:05 Swatinem

@supervacuus @Swatinem looks like this has been implemented with https://github.com/getsentry/sentry-native/commit/047cf98d993cc237a8cf7ecd9226b4712aad86e5#diff-84d598b3c4cc08e878cc83551a26a234018ddf3e72537e8b19ff62f5e83c8975 - can you confirm?

related PR: https://github.com/getsentry/sentry-native/pull/650

kahest avatar Sep 27 '23 10:09 kahest

Yes I believe it was

Swatinem avatar Sep 27 '23 14:09 Swatinem