-
Notifications
You must be signed in to change notification settings - Fork 831
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
Any way to reduce performance overhead in DefaultSynchronousMetricStorage? #6601
Comments
The If So if But the consequence of this is that the otel metrics SDK has to do additional work for every measurement. Measurements come in with all attributes, and the SDK needs to trim that attributes set down to the subset retained for aggregation. This takes CPU and memory. There may be ways to optimize AdviceAttributesProcessor, but I suspect they'll be minor improvements. |
@wgy035 how does this compare to the overhead of everything under |
This has been automatically marked as stale because it has been marked as needing author feedback and has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment. |
@jack-berg Thanks for your detailed response! I currently understand the purpose of I've observed that otel java agent has already traversed all attributes in the process of @trask In my performance test, it accounts for 9% of the total usage under |
Opened #6629 as a minor optimization to exit early when advice doesn't end up removing any attributes. This still doesn't help the common case of when advice does result in attributes being removed. |
Closing this after merging #6633. I know there is a another idea in the description to use a lock free alternative to |
Is your feature request related to a problem? Please describe.
While conducting a performance test, I discovered through flame graph analysis that
DefaultSynchronousMetricStorage.record()
causes extra performance overhead.Is there any way to reduce performance overhead in
DefaultSynchronousMetricStorage
?Describe the solution you'd like
1.The process of
AdviceAttributesProcessor
seems only remove some attributes from input and it cost a lot, could we skip the remove process?2.
CollectionAggregatorHandles
used ConcurrentHashMap, the performance is suboptimal in high concurrency scenarios, consider using a Lock-Free Queue instead, such as Disruptor or RingBuffer.Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: