-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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(apis): Pass query source to snuba - phase 3 #73499
Conversation
❌ 1 Tests Failed:
View the top 1 failed tests by shortest run timetests.snuba.api.endpoints.test_organization_events.OrganizationEventsProfilesDatasetEndpointTest�test_profiles_dataset_simple To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard |
@@ -338,6 +340,8 @@ def get(self, request: Request, organization) -> Response: | |||
elif referrer not in ALLOWED_EVENTS_REFERRERS: | |||
referrer = Referrer.API_ORGANIZATION_EVENTS.value | |||
|
|||
query_source = QuerySource.FRONTEND if is_frontend_request(request) else QuerySource.API |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a thought but it'd be nice if this was wrapped into a helper function like
def get_request_source(request: Request) -> QuerySource:
if is_frontend_request(request):
return QuerySource.FRONTEND
return QuerySource.API
This also gives you a single place to update in the future if there are additional query sources instead of having to update every caller with additional checks.
This pull request has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you add the label "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
d3154bf
to
fddbf48
Compare
0782fe6
to
c16ddc4
Compare
f064d4e
to
d2bcd89
Compare
a6ec9a3
to
1e9a12e
Compare
310420b
to
4cd93a0
Compare
b5fe8df
to
a6dbf85
Compare
e2479c5
to
d475540
Compare
045b9fb
to
226b5cf
Compare
226b5cf
to
8ad6996
Compare
Continuing #73497 to pass query source to snuba for more debuggability.
OrganizationEventsTraceBaseEndpoint
OrganizationsEventsNewTrendsStatsEndpoint
OrganizationsEventsEndpoint