Skip to content

nhcb: add optional field to prometheus remote write protobuf definition for custom bucket specification #13475

@krajorama

Description

@krajorama

Proposal

Related to prometheus/proposals#31

The histogram message type should have a new optional field that is a list of float64 values. These are to describe the custom bucket upper boundaries (excl. +Inf which is implicit). So basically encode what we currently put in the le label.

  • Add custom_bounds field to remote write specification 2.0 : types.proto.
      // custom_bounds specify upper bounds for the buckets
      // with arbitrary widths for this histogram. The upper bounds are inclusive (following `le` label semantics),
      // however, the previous bound specifies the lower bound (exclusive), making the bucket count
      // non-cumulative (as opposed to `le` semantics in the past).
      // Bounds have to be monotonically increasing.
      // The last element is also a lower bound for the implicit +Inf bucket (overflow buckets).
      // The first element is the upper inclusive boundary for the first bucket,
      // which implicitly has a lower inclusive bound of -Inf.
      repeated double custom_bounds =  16;
    
  • Update the note of the field schema to allow schema number 127. And also explain that in that case custom_bounds is taken into account for interpreting the custom buckets (stored in positive_spans, positive_deltas, positive_counts). Furthermore negative_spans, negative_deltas, negative_counts, zero_count and zero_threshold should be ignored.
  • Test what happens to Prometheus if we send a remote write request with custom bucket definition and schema value of 127 - Prometheus should gracefully reject the sample currently (regardless of native histogram feature toggle!)
  • Test the the field is truly optional and if not set, causes no problem.

This issue should target remote write 2.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions