Skip to content

Commit

Permalink
Add MaxScale config parameter to ExponentialHistogram (#3017)
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-berg authored Jan 13, 2023
1 parent 1239bd9 commit c8b7fdb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ release.

- Rename built-in ExemplarFilters to AlwaysOn, AlwaysOff and TraceBased.
([#2919](https://github.com/open-telemetry/opentelemetry-specification/pull/2919))
- Add `MaxScale` config option to Exponential Bucket Histogram Aggregation.
([#3017](https://github.com/open-telemetry/opentelemetry-specification/pull/3017))

### Logs

Expand Down
26 changes: 15 additions & 11 deletions specification/metrics/sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -456,16 +456,16 @@ The Exponential Histogram Aggregation informs the SDK to collect data
for the [Exponential Histogram Metric
Point](./data-model.md#exponentialhistogram), which uses an exponential
formula to determine bucket boundaries and an integer `scale`
parameter to control resolution.
parameter to control resolution. Implementations adjust scale as necessary given
the data.

Scale is not a configurable property of this Aggregation, the
implementation will adjust it as necessary given the data. This
Aggregation honors the following configuration parameter:
This Aggregation honors the following configuration parameters:

| Key | Value | Default Value | Description |
|---------|---------|---------------|--------------------------------------------------------------------------------------------------------------|
| MaxSize | integer | 160 | Maximum number of buckets in each of the positive and negative ranges, not counting the special zero bucket. |
| RecordMinMax | true, false | true | Whether to record min and max. |
| Key | Value | Default Value | Description |
|--------------|-------------|---------------|--------------------------------------------------------------------------------------------------------------|
| MaxSize | integer | 160 | Maximum number of buckets in each of the positive and negative ranges, not counting the special zero bucket. |
| MaxScale | integer | 20 | Maximum `scale` factor. |
| RecordMinMax | true, false | true | Whether to record min and max. |

The default of 160 buckets is selected to establish default support
for a high-resolution histogram able to cover a long-tail latency
Expand Down Expand Up @@ -500,8 +500,11 @@ bucketMidpoint = ((base - 1) / 2) / ((base + 1) / 2) = (base - 1) /
This Aggregation uses the notion of "ideal" scale. The ideal scale is
either:

1. The maximum supported scale, generally used for single-value histogram Aggregations where scale is not otherwise constrained
2. The largest value of scale such that no more than the maximum number of buckets are needed to represent the full range of input data in either of the positive or negative ranges.
1. The `MaxScale` (see configuration parameters), generally used for
single-value histogram Aggregations where scale is not otherwise constrained.
2. The largest value of scale such that no more than the maximum number of
buckets are needed to represent the full range of input data in either of the
positive or negative ranges.

###### Handle all normal values

Expand All @@ -519,7 +522,8 @@ nearest normal value.
###### Support a minimum and maximum scale

The implementation MUST maintain reasonable minimum and maximum scale
parameters that the automatic scale parameter will not exceed.
parameters that the automatic scale parameter will not exceed. The maximum scale
is defined by the `MaxScale` configuration parameter.

###### Use the maximum scale for single measurements

Expand Down

0 comments on commit c8b7fdb

Please sign in to comment.