Request to add environment variable for Span size limitation #12305
Labels
enhancement
New feature or request
needs author feedback
Waiting for additional feedback from the author
needs triage
New issue that requires triage
Is your feature request related to a problem? Please describe.
Hello, I would like to suggest an idea inspired by a problem that occurred during the process of Agent and Span collection. It would be helpful if there were an environment variable or feature to limit the size of Span objects.
During the additional Span and Attributes collection process, a memory leak issue occurred. This was caused by the Span collected by the Agent, and the Old Gen region significantly increased throughout the collection period.
I suspect that this issue happened due to 'large-sized Span - where the content of Attributes grew longer, causing premature promotion from Eden to Old Gen.' Upon examining the collected data, I found that a number of abnormal Spans exceeding a certain size were collected. (Of course, this was caused by my individual Extension and collection logic.) I suspect that this is what triggered the memory leak.
In fact, I didn’t anticipate the Span size would grow so large until I analyzed it using tools, which led to the server overload.
Heap Used Graph(Metric), Max Heap size 8gb
Major GC occurred
Describe the solution you'd like
Could you please consider adding an option to set a maximum size for individual Span instances through environment variables? For instance, if a Span exceeds the specified size in KB, it could be automatically discarded or the memory could be released immediately. This feature could also be configured based on GC settings (e.g., XX:PretenureSizeThreshold).
Describe alternatives you've considered
As described above.
Additional context
I find this Agent very useful. Thank you for reading.
The text was updated successfully, but these errors were encountered: