Request: More flexible API parameters for session events listing #2847
Replies: 2 comments
-
Created an issue to track this work: #2854 |
Beta Was this translation helpful? Give feedback.
0 replies
-
Closing this discussion as any relevant discussion should happen on the ticket. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Current Issue
The current sessions/{session}/events API only supports basic pagination, which creates performance problems when dealing with sessions that have accumulated many events over time.
Current API Limitations
The API currently supports:
pageSize - controls page size
pageToken - for pagination
filter - only timestamp range filtering
Events are returned in ascending order (oldest first), but most use cases need recent events (newest first).
Use Case
When a session has 50,000+ events but we only need the last 10 events, the current API forces us to:
Fetch all 500+ pages of historical data
Load everything into memory
Filter client-side to get the recent events
This is inefficient and doesn't scale well for long-running sessions.
Requested Features
Could the API support more flexible parameters like:
Reverse ordering: order=desc to get newest events first
Result limiting: limit=N to cap the number of results
Smart pagination: When combined with order=desc&limit=10, return only the most recent events without requiring full pagination
Example
Instead of fetching 500 pages:
events
We could have:
10
This would return just the 10 most recent events directly.
Question
Is this type of enhancement possible for the Session Events API? It would significantly improve performance for applications with long-running sessions.
Beta Was this translation helpful? Give feedback.
All reactions