-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
feat: Implement Session Stats API #22770
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
Conversation
This is a new API for querying sessions and has a query interface similar to discover, and returns timeseries data.
| # print(result_totals, result_timeseries) | ||
|
|
||
| with sentry_sdk.start_span(op="sessions.endpoint", description="massage_sessions_result"): | ||
| result = massage_sessions_result(query, result_totals, result_timeseries) |
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.
You could use a 'serializer' to convert the internal formats to the ones the client is expecting.
|
Some notes to clarify some strange things we saw while testing: Why do I get 3 intervals when using
|
An additional parameter should be relatively safe. Would you need to change the rounding of the interval, or would adjusting the We have some precedent for moving the start dates, as we quantize start dates to 5 min boundaries in discover to improve cache efficacy. |
|
I think this should round "upward", so for example now at 19:57 on 2021-01-12, when I request 2 days worth of 1 day intervals, it would round to I mean either way the rounding problem also becomes a timezone problem, since we round to UTC, so maybe expectations of people in other timezones would be different in that case, hm. |
markstory
left a comment
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.
It would be good to have a couple of endpoint tests that check succesful queries, queries with invalid fields, and project permission problems.
markstory
left a comment
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.
Thanks for adding the endpoint tests. You may need to relax your assertions to get the tests to pass.
This is a new API for querying sessions and has a query interface similar to discover, and returns timeseries data.
Example URL: http://localhost:8000/api/0/organizations/sentry/sessions/?project=1&statsPeriod=1d&interval=6h&field=sum(session)&field=count_unique(user)&groupBy=release&groupBy=session.status
TODO: