-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[processor/spanmetrics] Prune histograms #27083
[processor/spanmetrics] Prune histograms #27083
Conversation
1150f37
to
70daeff
Compare
70daeff
to
9375a88
Compare
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.
Thanks @nijave!
Please be advised though that the spanmetricsprocessor is deprecated.
I believe the spanmetricsconnector does prune histograms, however, please let me know if I've misunderstood something.
|
Ahh, if this is related to memory management and concerns, then performing a The easiest way to address this is use pointer values for the value type since it keeps the memory allocated small. lastly, this is a deprecated component you're trying to update. Could you please apply the fix to the connector version instead? |
It's less about memory management and more about controlling Prometheus Usually what's happening for us, some errors come in and generate new series. They drop off but the series stick around until the agents are restarted which can be weeks or even months. We also have batch jobs and other periodic workloads that emit trace data occasionally but not regularly and these pile up as well. We're using Grafana Agent which pulls this in as a library and we need to rewrite/test our config using their new config pattern if we want to use connector so, for us, we need to update our deprecated Grafana Agent config first. If I have time, I'll take a look at the connector and see if it has the same problem. I'm actually switching jobs so after Oct 6th, I won't have a real environment available to test changes anymore. |
That is interesting--I'm not very well versed in |
@nijave I've rerun the tests, could I ask you to address any failures and provide a changelog? Considering this is related to the Grafana, I'll cc @jpkrohling to see if they can also address this upstream as well :) |
1b3417a
to
5633c3f
Compare
5633c3f
to
5946572
Compare
Ok, I think I addressed all the issues. I have grafana/agent#5271 open on Grafana Agent (I think it's linked in the corresponding issue in this repo but not on this PR) |
Prune histograms when the dimension cache evictions are removed
5946572
to
926f2a3
Compare
# Use this changelog template to create an entry for release notes. | ||
|
||
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' | ||
change_type: bug_fix |
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.
Not really sure about this one. Technically this will produce less metric series than it previously did (the output of this component is changing) but my understanding was it was always intended that metric series (histograms) get pruned at the same time as dimensions cache map.
i.e. it was a bug these histograms weren't being pruned
Prune histograms when the dimension cache evictions are removed **Description:** Prunes histograms when the dimension cache is pruned. This prevents metric series from growing indefinitely **Link to tracking Issue:** open-telemetry#27080 **Testing:** I modified the the existing test to check `histograms` length instead of dimensions cache length. This required simulating ticks to hit the exportMetrics function **Documentation:** <Describe the documentation added.> Co-authored-by: Sean Marciniak <30928402+MovieStoreGuy@users.noreply.github.com>
Here's some numbers after running in our dev environment for a day with this change grafana/agent#5271 (comment) |
Prune histograms when the dimension cache evictions are removed **Description:** Prunes histograms when the dimension cache is pruned. This prevents metric series from growing indefinitely **Link to tracking Issue:** open-telemetry#27080 **Testing:** I modified the the existing test to check `histograms` length instead of dimensions cache length. This required simulating ticks to hit the exportMetrics function **Documentation:** <Describe the documentation added.> Co-authored-by: Sean Marciniak <30928402+MovieStoreGuy@users.noreply.github.com>
Prune histograms when the dimension cache evictions are removed
Description:
Prunes histograms when the dimension cache is pruned. This prevents metric series from growing indefinitely
Link to tracking Issue:
#27080
Testing:
I modified the the existing test to check
histograms
length instead of dimensions cache length. This required simulating ticks to hit the exportMetrics functionDocumentation: