Skip to content

Commit

Permalink
Switch to base 2 and powers of 2 for resolution
Browse files Browse the repository at this point in the history
This follows what looks to be the winning proposal in
open-telemetry/oteps#149

See more detail in upcoming commit for prometheus/client_golang.

Signed-off-by: beorn7 <beorn@grafana.com>
  • Loading branch information
beorn7 committed Jun 11, 2021
1 parent 8831f0d commit bbaf1cc
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 59 deletions.
121 changes: 63 additions & 58 deletions go/metrics.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion io/prometheus/client/metrics.proto
Expand Up @@ -61,7 +61,12 @@ message Histogram {
optional double sample_sum = 2;
repeated Bucket bucket = 3; // Ordered in increasing order of upper_bound, +Inf bucket is optional.
// Sparse bucket (sb) stuff:
optional uint32 sb_resolution = 4; // That many buckets per power of ten. Must be <256. Zero for no sparse buckets.
// The sb_schema defines the bucket schema. Currently, valid numbers are -4 <= n <= 8.
// They are all for base-2 bucket schemas, where 1 is a bucket boundary in each case, and
// then each power of two is divided into 2^n logarithmic buckets.
// Or in other words, each bucket boundary is the previous boundary times 2^(2^-n).
// In the future, more bucket schemas may be added using numbers < -4 or > 8.
optional sint32 sb_schema = 4;
optional double sb_zero_threshold = 5; // Breadth of the zero bucket.
optional uint64 sb_zero_count = 6; // Count in zero bucket.
optional SparseBuckets sb_negative = 7; // Negative sparse buckets.
Expand Down

0 comments on commit bbaf1cc

Please sign in to comment.