-
Notifications
You must be signed in to change notification settings - Fork 446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize Metric Processing for Single Collector with Delta Temporality #3236
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for opentelemetry-cpp-api-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3236 +/- ##
==========================================
+ Coverage 88.16% 88.18% +0.02%
==========================================
Files 198 198
Lines 6224 6241 +17
==========================================
+ Hits 5487 5503 +16
- Misses 737 738 +1
|
if (collectors.size() == 1 && collector->GetAggregationTemporality( | ||
instrument_descriptor_.type_) == AggregationTemporality::kDelta) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: use the aggregation_temporarily
local variable, from the previous line, in the if test.
return true; | ||
}); | ||
|
||
return callback(metric_data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No idea if this can happen or not, does the code in the fast path needs to pay attention to previous metrics in unreported_metrics_
?
If not, consider to add a comment to explain why, and/or an assert to make sure there are no unreported metrics.
This introduces a fast path for cases with a single collector/reader using delta temporality. It skips unnecessary intermediate processing and directly generates metrics for callback, reducing memory usage and CPU overhead. This change is supposed to improve performance for common single-collector scenarios while retaining existing functionality for other cases.
Changes
Please provide a brief description of the changes here.
For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes