From 51d66fc59a3eb9bb73c36d678539ea84dd4c02ac Mon Sep 17 00:00:00 2001 From: Reiley Yang Date: Wed, 21 Sep 2022 08:18:16 -0700 Subject: [PATCH] Change the default buckets for Explicit Bucket Histogram (#2770) --- CHANGELOG.md | 4 ++++ specification/metrics/sdk.md | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 006f8f87c2d..baa1adff61d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,10 @@ release. ### Metrics +- Changed the default buckets for Explicit Bucket Histogram to better match the + official Prometheus clients. + ([#2770](https://github.com/open-telemetry/opentelemetry-specification/pull/2770)). + ### Logs ### Resource diff --git a/specification/metrics/sdk.md b/specification/metrics/sdk.md index 402e2b14d6e..233d93fa210 100644 --- a/specification/metrics/sdk.md +++ b/specification/metrics/sdk.md @@ -431,7 +431,7 @@ This Aggregation honors the following configuration parameters: | Key | Value | Default Value | Description | | --- | --- | --- | --- | -| Boundaries | double\[\] | [ 0, 5, 10, 25, 50, 75, 100, 250, 500, 1000 ] | Array of increasing values representing explicit bucket boundary values.

The Default Value represents the following buckets:
(-∞, 0], (0, 5.0], (5.0, 10.0], (10.0, 25.0], (25.0, 50.0], (50.0, 75.0], (75.0, 100.0], (100.0, 250.0], (250.0, 500.0], (500.0, 1000.0], (1000.0, +∞) | +| Boundaries | double\[\] | [ 0, 5, 10, 25, 50, 75, 100, 250, 500, 750, 1000, 2500, 5000, 7500, 10000 ] | Array of increasing values representing explicit bucket boundary values.

The Default Value represents the following buckets (heavily influenced by the default buckets of Prometheus clients, e.g. [Java](https://github.com/prometheus/client_java/blob/6730f3e32199d6bf0e963b306ff69ef08ac5b178/simpleclient/src/main/java/io/prometheus/client/Histogram.java#L88) and [Go](https://github.com/prometheus/client_golang/blob/83d56b1144a0c2eb10d399e7abbae3333bebc463/prometheus/histogram.go#L68)):
(-∞, 0], (0, 5.0], (5.0, 10.0], (10.0, 25.0], (25.0, 50.0], (50.0, 75.0], (75.0, 100.0], (100.0, 250.0], (250.0, 500.0], (500.0, 750.0], (750.0, 1000.0], (1000.0, 2500.0], (2500.0, 5000.0], (5000.0, 7500.0], (7500.0, 10000.0], (10000.0, +∞). SDKs SHOULD use the default value when boundaries are not explicitly provided, unless they have good reasons to use something different (e.g. for backward compatibility reasons in a stable SDK release). | | RecordMinMax | true, false | true | Whether to record min and max. | Explicit buckets are stated in terms of their upper boundary. Buckets