openmeter
openmeter copied to clipboard
Add pagination to event queries
Preflight Checklist
- [X] I have searched the issue tracker for an issue that matches the one I want to file, without success.
Problem Description
When retrieving a list of events trough the API you need to specify a limit
for the number of elements returned. This can work fine for very constrained queries, but doesn't scale to high numbers of results.
Proposed Solution
Add pagination parameters to the query (e.g. page-size
and page
) to be able to retrieve specific parts of the query result.
Alternatives Considered
With the current API, it should be possible to implement infinite scrolling by querying for the events older than the last event retrieved. However, this seems hacky and doesn't support other types of pagination (like jumping directly to page n).
Additional Information
Although the existing /query
endpoint is a great way to power visual dashboards, we believe that being able to properly navigate disaggregated usage records is equally important and currently lacking.