Histogram Aggregation - core SDK implementation#2581
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2581 +/- ##
===========================================
+ Coverage 0 87.12% +87.12%
- Complexity 0 2666 +2666
===========================================
Files 0 323 +323
Lines 0 8908 +8908
Branches 0 904 +904
===========================================
+ Hits 0 7761 +7761
- Misses 0 856 +856
- Partials 0 291 +291
Continue to review full report at Codecov.
|
bogdandrutu
left a comment
There was a problem hiding this comment.
I am confused about the series of PRs sent. Can we start with a minimal PR that just adds the data type, then one PR that adds the aggregator, then PRs to plug it to the exporters
heh. this was my request to break up the original into 3 PRs. this is the first one in the series at the moment. |
sorry for the confusion. the original PR #2575 was divided up to 3 PR following the advice from the comments. will update the description to make it more clear. if you think the |
| private static final DoubleSummaryData DEFAULT_DOUBLE_SUMMARY_DATA = | ||
| DoubleSummaryData.create(Collections.emptyList()); | ||
| private static final DoubleHistogramData DEFAULT_DOUBLE_HISTOGRAM_DATA = | ||
| DoubleHistogramData.create(AggregationTemporality.CUMULATIVE, Collections.emptyList()); |
There was a problem hiding this comment.
can we really hard-code CUMULATIVE here? Shouldn't it depend on how the aggregation is configured?
There was a problem hiding this comment.
it's a default & fallback value when we try to get the histogram data from an instance of MetricData whose type is not HISTOGRAM. I would assume something is wrong if this happens.
|
This seems pretty close to me, but I'd like our local metrics expert, @bogdandrutu to review before we merge. Also, it's worth noting that the OTel metrics data model is about to get a re-think, which could lead to needing to update things in here, depending on the outcome of those discussions. |
Thanks for the review and all the comments. as of the data model re-thinking, is there any reference that I could follow up? |
I think there are meetings being put on the public calendar where this is being discussed. I'd start by looking at recent metrics SIG meeting notes. |
|
@beanliu sorry for taking too long to look into this. We just finished the tracing review, and we can now look into metrics again :) |
@bogdandrutu thanks for the comments. not sure if I understand correctly, given the review is in progress, are u suggesting splitting this PR again? |
|
Unfortunately I have some time sensitive tasks at work for the next 2 days. I will come back to you asap. Regarding splitting. I know I review but was a very high level review to be honest because there are a lot of changes in this PR. But I think if you were to split probably would be way faster to merge this. |
the original PR #2575 was divided up to 3 PR following the advice from the comments.
they are not fully independent of each other and share some common commits, here's a simple description of their relationships in commits:
links of follow up PRs: #2582 #2583
Support fixed bucket histogram aggregation and exporting them with OTLP/Prometheus exporter.
Since the View API is not part of the public Metric API yet (optentelemetry-specification#466), there's no universal way to configure custom aggregators for different instruments. However, the
SdkMeterProviderprovides aregisterViewmethod which allows developers to specify aggregations for certain instruments. This suggests that we could do the following to achieve histogram aggregations:And we could upgrade the example to use View API once they are ready.