Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[grouping] Improve Python in_app frame behavior #83603

Open
lobsterkatie opened this issue Jan 16, 2025 · 0 comments
Open

[grouping] Improve Python in_app frame behavior #83603

lobsterkatie opened this issue Jan 16, 2025 · 0 comments

Comments

@lobsterkatie
Copy link
Member

lobsterkatie commented Jan 16, 2025

Lots of conversation about how both our server-side code and the Python SDK handle marking frames in or out of app has occurred in #79482, getsentry/sentry-python#3682, getsentry/sentry-python#3671, getsentry/sentry-python#3672, and #79357. This issue supersedes them all, and includes our final plan.

The problem:

There are currently four ways the in_app value for a given Python frame can be set:

  • By the user in the SDK, using the in_app_include and in_app_exclude options
  • By the SDK itself, based on logic here
  • By the user, using custom stacktrace rules
  • By the server, based on logic here and here

The problem is that the precedence between these ways isn't always honored the way it should be. (Specifically, our server-side values can override values the user has set using the SDK, which means that those options are in some sense "broken.") Also, there's duplication of logic in terms of the automatically set values, between the SDK and the server.

The solution:

Through discussion in the above-linked issues, the agreed-upon solution is:

  • The SDK will stop automatically setting values, and only set values based on the two in_app options set by the user.
  • All logic for automatically setting values will move to the server.
  • The server will allow server-side stacktrace rules to override SDK-set values (this matches the way fingerprinting rules work), but won't allow our internal logic to override values from the SDK.

This means that the final precedence order will be (highest to lowest):

  • Server-side stacktrace rules set by the user
  • The SDK in_app_include option
  • The SDK in_app_exclude option
  • Internal sever-side rules set in the grouping config
  • A default value of false if the value hasn't been set by any of the above

Basically, values set by the user beat values set by us, and within that, server values beat SDK values.

Tasks:

  • Incorporate any internal logic from the SDK in the server-side grouping config
  • Remove internal logic from the SDK
  • Ensure that grouping config values don't override SDK-set values, since now by definition they will be coming from the user
  • Document this somewhere? Probably should be in both the SDK docs and the stacktrace rule docs (which should link to one another if they don't already).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant