Skip to content
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

deltatocumulative: evict only stale streams #33015

Merged

Conversation

sh0rez
Copy link
Contributor

@sh0rez sh0rez commented May 13, 2024

changes eviction behavior at limit to only delete streams if they are actually stale. Current behavior just deletes the oldest, which leads to rapid deletion of all streams under heavy load, making this processor unusable.

Description:

Link to tracking Issue:
Fixes #33014

Testing:

Documentation:

changes eviction behavior at limit to only delete streams if they are
actually stale. Current behavior just deletes the oldest, which leads to
rapid deletion of all streams under heavy load, making this processor unusable.
@sh0rez sh0rez force-pushed the deltatocumulative-evict-only-stale branch from 4f85f2a to 5c92bd3 Compare May 13, 2024 13:16
@@ -59,5 +59,5 @@ func (m HashMap[T]) Clear() {
// Evictors remove the "least important" stream based on some strategy such as
// the oldest, least active, etc.
type Evictor interface {
Evict() identity.Stream
Evict() (identity.Stream, bool)
Copy link
Contributor

@RichieSams RichieSams May 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you document what the returns are

internal/exp/metrics/staleness/staleness.go Show resolved Hide resolved
// if not already tracked and no space: try to evict
if !exist && m.Map.Len() >= m.Max {
errl := ErrLimit(m.Max)
gone, ok := m.Evictor.Evict()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for a future PR: it would be nice to have an eviction counter, if there isn't one already

@jpkrohling
Copy link
Member

I'm merging, as @sh0rez is out for a week and I think the comments from this PR can be addressed in a follow-up PR.

@jpkrohling jpkrohling merged commit 88e6edb into open-telemetry:main May 16, 2024
162 checks passed
@github-actions github-actions bot added this to the next release milestone May 16, 2024
sh0rez added a commit to sh0rez/opentelemetry-collector-contrib that referenced this pull request May 27, 2024
jpkrohling pushed a commit that referenced this pull request May 29, 2024
**Description:** 
fixes broken check in eviction behavior such that it only evicts
actually stale metrics.
this was already attempted in #33015, but was insufficient


**Testing:** tests were added
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[processor/deltatocumulative]: evicts all streams under heavy load
4 participants