Skip to content

Commit

Permalink
Add docs for OTLP Exponential Histogram (#5386)
Browse files Browse the repository at this point in the history
  • Loading branch information
lenin-jaganathan committed Aug 13, 2024
1 parent 6b5eb02 commit d5f3bef
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions docs/modules/ROOT/pages/implementations/otlp.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ https://opentelemetry.io/docs/specs/otel/metrics/data-model/#metric-points[Metri
1. https://opentelemetry.io/docs/specs/otel/metrics/data-model/#sums[Sums, window=_blank]
2. https://opentelemetry.io/docs/specs/otel/metrics/data-model/#gauge[Gauge, window=_blank]
3. https://opentelemetry.io/docs/specs/otel/metrics/data-model/#histogram[Histogram, window=_blank]
4. https://opentelemetry.io/docs/specs/otel/metrics/data-model/#summary-legacy[Summary, window=_blank]
4. https://opentelemetry.io/docs/specs/otel/metrics/data-model/#exponentialhistogram[Exponential Histogram, window=_blank]
5. https://opentelemetry.io/docs/specs/otel/metrics/data-model/#summary-legacy[Summary, window=_blank]

The following table maps OTLP data points and the Micrometer meters:

Expand All @@ -84,12 +85,13 @@ The following table maps OTLP data points and the Micrometer meters:
|Gauge
|Gauge, TimeGauge, MultiGauge

|Histogram
|Histogram/Exponential Histogram^*^
|Timer, DistributionSummary, LongTaskTimer, FunctionTimer (only sum and count are set)

|Summary
|Timer, DistributionSummary, LongTaskTimer
|===
__* - Histogram or Exponential Histogram is determined based on the configuration of the `OtlpMeterRegistry`. See below section for more info.__

*Note*:

Expand All @@ -107,16 +109,25 @@ Micrometer `Timer` and `DistributionSummary` support configuring xref:/concepts/
| Summary

| publishPercentileHistogram
| Histogram
| Histogram/Exponential Histogram ^*^

| serviceLevelObjectives
| Histogram

| publishPercentiles and (publishPercentileHistogram/serviceLevelObjectives)
| Histogram
|===
__* The configuration `histogramFlavor` determines whether the OTLP DataPoint is a Histogram/Exponential Histogram.__

`OtlpMeterRegistry` supports 2 types of Histogram implementations (1.Explicit Bucket Histogram (or simply called Histogram), 2. Exponential Histogram) when `publishPercentileHistogram` is configured. The choice is chosen by setting `histogramFlavor` in `OtlpConfig` used by registry. When the implementation is exponential histogram, it also supports 2 additional properties

1. maxScale used to cap the maximum https://opentelemetry.io/docs/specs/otel/metrics/data-model/#exponential-scale[scale, window=_blank] used by the Exponential Histogram (defaults to 20).
2. maxBuckets determines the maximum number of https://opentelemetry.io/docs/specs/otel/metrics/data-model/#exponential-buckets[buckets, window=_blank] to be used for exponential histograms (defaults to 160).

Since Exponential Histogram cannot have custom SLO's specified, explicit bucket histogram is used whenever `serviceLevelObjectives` are added.

Alternatively, if you use Spring Boot, you can use the https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#actuator.metrics.customizing.per-meter-properties[per-meter properties, window=_blank] to configure this behavior.
=== Configuration with Spring Boot
If you use Spring Boot, you can use the https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#actuator.metrics.customizing.per-meter-properties[per-meter properties, window=_blank] to configure this behavior.

If you want to generate a Histogram data point for a Timer with name `test.timer` and default buckets generated by Micrometer, use:

Expand Down

0 comments on commit d5f3bef

Please sign in to comment.