open-telemetry / opentelemetry-collector-contrib

Contrib repository for the OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
2.92k stars 2.29k forks source link

[connectors/spanmetrics] Use OTel Exponential Histogram to observe measurements for the latency metric. #18528

Closed kovrus closed 1 year ago

kovrus commented 1 year ago

Component(s)

processor/spanmetrics connector/spanmetrics

Is your feature request related to a problem? Please describe.

Currently, the fixed bucket histogram is used to observe latency measurements which requires providing the explicit bucket boundaries as the configuration parameter. It can be improved with adoption of the exponential histogram. We should probably use seconds as units, see https://github.com/open-telemetry/opentelemetry-specification/issues/2977

Describe the solution you'd like

Support OTel Exponential Histogram to observe measurements for the latency metric in the spanmetrics processor. It can be hidden behind feature gate for now.

Describe alternatives you've considered

No response

Additional context

No response

github-actions[bot] commented 1 year ago

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

github-actions[bot] commented 1 year ago

Pinging code owners for connector/spanmetrics: @albertteoh. See Adding Labels via Comments if you do not have permissions to add labels yourself.

gouthamve commented 1 year ago

Note that the default aggregation for histograms is still Explicit Bucket Histogram Aggregation: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#default-aggregation

Not all backends support exponential histograms, but we should give the option to the users to produce exponential histograms if they want to.

However, we should switch to seconds probably in any case.

kovrus commented 1 year ago

However, we should switch to seconds probably in any case.

It should be probably a separate issue on the connectors/spanmetrics.