feat(grouping): Use project_root
for in-app logic
#84156
Draft
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.
In the python SDK, we automatically mark frames whose filepath matches the project root as being in-app. As we are now moving to a world where all auto-in-app detection happens on the server, we need to replicate that logic in sentry.
The first step in this change is handled in getsentry/sentry-python#3941, which sends the
project_root
value used in the current SDK logic to the server indebug_meta
. This is the second step: using that value on the server to set frames'in-app
values. Once this is live, we can remove the corresponding logic from the SDK.Because we apply the server-side
in_app
logic in two different places for a total of three times per event (once to set in-app values, and once each for the app and system variants to get hints), the easiest way to incorporate the new logic was to bundle it in with our other built-in stacktrace rules. That way, it gets applied all three times the others do.We don't currently have the ability to include variables in stacktrace rules the way we do in fingerprint rules, so this is done by manually constructing the rule text and merging it into the already-loaded config before any stacktrace rules are applied. It's not gated by platform, but since for now the Python SDK is the only one sending
debug_meta.project_root
, it's effectively restricted to Python events.