Skip to content

Merge Tags when sending event #535

Description

@xamix

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions