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

feat(spans): only extract user.geo.subregion if mobile or frontend project #4013

Merged

Conversation

DominikB2014
Copy link
Contributor

@DominikB2014 DominikB2014 commented Sep 6, 2024

work towards getsentry/sentry#75230

We saw a noticeable increase in clickhouse rows after tagging spans with user.geo.subregion. However, this feature is only intended for frontend and mobile, so it makes sense we just don't allow other SDKs to extract these tags.

This should help a lot, if you look at the sentry org, the sentry backend project emits a most 330k http spans per minute, while the frontend emits at most 30k.

@DominikB2014 DominikB2014 requested a review from a team as a code owner September 6, 2024 14:50
@@ -178,6 +178,7 @@ expression: metrics
"transaction": "gEt /api/:version/users/",
"transaction.method": "POST",
"transaction.op": "myop",
"user.geo.subregion": "155",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something to note here, this was added here because we added the browser context to the test event, if the browser context was missing, these tags would not be added to any spans.

Copy link
Member

@iambriccardo iambriccardo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@DominikB2014 DominikB2014 merged commit 23a5303 into master Sep 9, 2024
24 checks passed
@DominikB2014 DominikB2014 deleted the DominikB2014/only-capture-geo-location-backend-mobile branch September 9, 2024 13:44
DominikB2014 added a commit that referenced this pull request Sep 11, 2024
This is an extension of this PR
#4013

I assumed that Backend SDK transactions would not have a browser
context, so i used that as a means to check if the project is a frontend
project. Turns out, python SDKs still set browser context on the
transaction (I guess this is the browser the user made the request
from?). So to fix this, we can just check the platform directly as
frontend is typically/always javascript.

---------

Co-authored-by: Joris Bayer <joris.bayer@sentry.io>
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

Successfully merging this pull request may close these issues.

2 participants