Skip to content

Returning OxQL timeseries data as an object requires needless transformation #8108

@wfchandler

Description

@wfchandler

The data returned by OxQL is formatted along these lines, with the timeseries data being an object:

{
  "tables": [
    {
      "name": "<METRIC_NAME>",
      "timeseries": {
        "421118574608206050": {
          "fields": { <FIELDS> },
          "points": { <POINTS> },
          "values": { <VALUES> }
        },
        "637422258989466863": {
          "fields": { <FIELDS> },
          "points": { <POINTS> },
          "values": { <VALUES> }
        },
        "771960562175568387": {
          "fields": { <FIELDS> },
          "points": { <POINTS> },
          "values": { <VALUES> }
        }
      }
    }
  ]
}

The integer keys used for each timeseries object is of no meaning to consumers and must be stripped out before accessing the actual payload.

In our own tooling we are doing this here and here, and customers consuming our metrics have also needed to do the same.

Setting timeseries as an array would allow the data to be more readily consumed:

{
  "tables": [
    {
      "name": "<METRIC_NAME>",
      "timeseries": [
        {
          "fields": { <FIELDS> },
          "points": { <POINTS> },
          "values": { <VALUES> }
        },
        {
          "fields": { <FIELDS> },
          "points": { <POINTS> },
          "values": { <VALUES> }
        },
        {
          "fields": { <FIELDS> },
          "points": { <POINTS> },
          "values": { <VALUES> }
        }
      ]
    }
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    MetricscustomerFor any bug reports or feature requests tied to customer requestsoxqlOximeter Query Langauge

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions