wu-sheng commented on code in PR #10449:
URL: https://github.com/apache/skywalking/pull/10449#discussion_r1118833407
##########
oap-server/server-receiver-plugin/otel-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/otel/otlp/OpenTelemetryMetricRequestProcessor.java:
##########
@@ -161,6 +163,57 @@ private static Map<Double, Long> buildBuckets(
return result;
}
+ /**
+ * ExponentialHistogram data points are an alternate representation to the
Histogram data point in OpenTelemetry
+ * metric
format(https://opentelemetry.io/docs/reference/specification/metrics/data-model/#exponentialhistogram).
+ * It uses scale, offset and bucket index to calculate the bound. Firstly,
calculate the base using scale by
+ * formula: base = 2**(2**(-scale)). Then the upperBound of specific
bucket can be calculated by formula:
+ * base**(offset+index+1). Above calculation way is about positive
buckets. For the negative case, we just
+ * map them by their absolute value into the negative range using the same
scale as the positive range. So the
+ * upperBound should be calculated as -base**(offset+index).
+ *
+ * We temporarily ignored the zero_count field, because the zero_threshold
even could cover over the existing
+ * bucket scopes. The discussion is in pull request #10449.
Review Comment:
```suggestion
* Ignored the zero_count field temporarily,
* because the zero_threshold even could overlap the existing bucket
scopes.
```
Usually, we don't use `we` in the comments. The codes are we :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]