-
Notifications
You must be signed in to change notification settings - Fork 53
nexus: Remove TimeseriesKey from timeseries output #8842
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
215aca7
to
629486e
Compare
Our external API timeseries endpoints currently return data as a `BTreeMap<TimeseriesKey, Timeseries>`, which results in JSON output with arbitrary numeric keys that have no meaning to API consumers: ```json { "timeseries": { "2352746367989923131": { ... }, "3940108470521992408": { ... } } } ``` This commit introduces a new `TableOutput` struct that presents timeseries data as an array instead of a map. The `TableOutput` type is converted from the internal `Table` representation at the API boundary, preserving the ordering from the original `BTreeMap` while providing a cleaner JSON structure: ```json { "timeseries": [ { ... }, { ... } ] } ``` Closes #8108
629486e
to
dfc2cf4
Compare
Love the idea, Edit: I see now it’s inside OxqlQueryResult. In that case I think I prefer Table over TableOutput, though neither is a great name for an array of timeseries. |
@david-crespo agreed. Just |
|
FYI @askfongjojo, this will slightly change how we parse OxQL results. I'll update the /cc @jmcarp I think you've been working on tooling for our metrics. |
Hmm, actually I think the metrics exporter will handle this without change as it uses |
Our external API timeseries endpoints currently return data as a
BTreeMap<TimeseriesKey, Timeseries>
, which results in JSON output with arbitrary numeric keys that have no meaning to API consumers:This commit introduces a new
TableOutput
struct that presents timeseries data as an array instead of a map. TheTableOutput
type is converted from the internalTable
representation at the API boundary, preserving the ordering from the originalBTreeMap
while providing a cleaner JSON structure:Closes #8108