fix: sync default tags to native layer#5214
Open
bitsandfoxes wants to merge 2 commits intomainfrom
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5214 +/- ##
=======================================
Coverage 74.14% 74.14%
=======================================
Files 506 506
Lines 18292 18295 +3
Branches 3576 3578 +2
=======================================
+ Hits 13562 13565 +3
Misses 3859 3859
Partials 871 871 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Came up through and resolves getsentry/sentry-unity#2668
The Problem
When a user sets
DefaultTagson the options, these tags do not make it to native events from Android or iOS. This is not only an issue for Unity but affects C# Android and iOS app as well.The comment seems to be out of date and prior to the addition of the extensive native support the SDK has now.
Context
When a user sets the
DefaultTagson the options, in the regular processing pipeline, these get applied by theEnricheron each individual event.sentry-dotnet/src/Sentry/Internal/Enricher.cs
Line 104 in af4ebc3
I don't know what the grand design here was, and why tags are not getting applied to the scope instead. Maybe this comes from one of the other integrations, or behaviour outside of having a
GlobalScope? If not, we could move it out of theEnricherin general. Happy to follow up on this if that's the case.Proposal
During initialization, and if scope sync is enabled, and if there is a
ScopeObserver, we set those tags, making them available on the native layer. The regular flow inside the C# processing stays preserved.Sample events taken from the Unity SDK with
options.DefaultTags.Add("my", "tag");: