-
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
[connector/spanmetrics] Discard counter span metric exemplars after flushing #32210
[connector/spanmetrics] Discard counter span metric exemplars after flushing #32210
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #32210 +/- ##
=======================================
Coverage 81.98% 81.99%
=======================================
Files 1912 1912
Lines 173444 173443 -1
=======================================
+ Hits 142197 142209 +12
+ Misses 26920 26906 -14
- Partials 4327 4328 +1 ☔ View full report in Codecov by Sentry. |
212cbf3
to
a695ee0
Compare
I also agree with that:
|
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.
LGTM, Thank you @swar8080
} | ||
|
||
m.metrics = make(map[Key]*exponentialHistogram) |
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 situation where we need to retain this functionality? This is the only bit that stands out.
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.
yep this was dead code
Reset(onlyExemplars bool)
was only called with true
as the parameter, so the function would always return early before reaching the code path I deleted
Description:
Discard counter span metric exemplars after flushing to avoid unbounded memory growth when exemplars are enabled.
This is needed because #28671 added exemplars to counter span metrics, but they are not removed after each flush interval like they are for histogram span metrics.
Note: this may change behaviour if using the undocumented
exemplars.max_per_data_point
configuration option, since exemplars would no longer be accumulated up until that count. However, i'm unclear on the value of that feature since there's no mechanism to replace old exemplars with newer ones once the maximum is reached. Maybe a follow-up enhancement is only discarding exemplars once the maximum is reached, or using a circular buffer to replace them. That could be useful for pull-based exporters likeprometheusexporter
, as retaining exemplars for longer would decrease the chance of them getting discarded before being scraped.Link to tracking Issue:
Closes #31683
Testing:
Documentation:
Updated the documentation to mention that exemplars are added to all span metrics. Also mentioned when they are discarded