Skip to content

Clean up oxql histogram responses #9345

@jmcarp

Description

@jmcarp

Related to #9324, but distinct.

For histogram metrics, the OxQL endpoint returns a quantile for the p50, p90, and p99 of the histogram, in addition to bucket boundaries and counts. This type is a bit opaque to the end-user, who might not be familiar with the P² algorithm, and includes docs about implementation details that I'm guessing should be internal. Here's an example api response:

...
"p50": {
  "desired_marker_positions": [
    67113772.0,
    4.25,
    7.5,
    10.75,
    14.0
  ],
  "marker_heights": [
    65172855.0,
    98236867.20436507,
    114319734.61547618,
    139226215.7027778,
    163392545.0
  ],
  "marker_positions": [
    1,
    4,
    7,
    11,
    14
  ],
  "p": 0.5
}
...

I think the relevant part of this is that we've estimated the p50 of this series to be 114319734.61547618, the third of the five markers. Although maybe it's also useful to know the p/5 and (1+p)/2 quantile estimates as well? The first and final markers, which represent the min and max of the series, seem to be redundant, since we extract them into their own fields in the parent Histogram struct.

I would like to do two things here:

  • Simplify/clarify the response type for histograms, so that we only include useful information, and so that users can tell what it means. This might mean just showing the quantile estimates, or hoisting them into Histogram for clarity if there's value in including the full set of markers in the response.
  • Updating the docs to explain histograms better. We're providing users with two different ways to estimate quantiles: estimates of a few specified quantiles via the P² algorithm, as well as buckets and counts that allow users to calculate arbitrary quantiles, e.g. using linear interpolation. I think we can do more to explain this to users, and when they might want to use different parts of the histogram response.

cc, as usual, @bnaecker. I'm happy to make any of these changes if they make sense, or not if they don't.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions