-
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
spanmetrics connector has memory leak #27654
Labels
Comments
bripkens
added
bug
Something isn't working
needs triage
New item requiring triage
labels
Oct 12, 2023
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
bryan-aguilar
added
priority:p1
High
and removed
needs triage
New item requiring triage
labels
Oct 13, 2023
Thanks for the report @bripkens, are you interested in working on a fix? |
Fix proposal added via #28847 |
Sounds related, yes. I'd argue however that just pruning histograms is not sufficient. See my (open) PR which would fix this: #28847 |
bripkens
added a commit
to bripkens/opentelemetry-collector-contrib
that referenced
this issue
Dec 5, 2023
# Why The `spanmetrics` connector has a memory leak that occurs when the cumulative temporality is used. The `connectorImp#resourceMetrics` map is only ever cleaned up in delta temporality. # What Turn `connectorImp#resourceMetrics` into a LRU cache with a maximum size. To correctly handle metric resets we also introduce a start timestamp per `resourceMetric` instance. # References Fixes open-telemetry#27654 Co-authored-by: Jared Tan <[email protected]>
TylerHelmuth
pushed a commit
that referenced
this issue
Dec 5, 2023
# Why The `spanmetrics` connector has a memory leak that occurs when the cumulative temporality is used. The `connectorImp#resourceMetrics` map is only ever cleaned up in delta temporality. # What Turn `connectorImp#resourceMetrics` into a LRU cache with a maximum size. To correctly handle metric resets we also introduce a start timestamp per `resourceMetric` instance. # References Fixes #27654 Co-authored-by: Jared Tan <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Component(s)
connector/spanmetrics
What happened?
Description
The
spanmetrics
connector has a memory leak that occurs when the cumulative temporality is used. TheconnectorImp#resourceMetrics
map is only ever cleaned up in delta temporality.opentelemetry-collector-contrib/connector/spanmetricsconnector/connector.go
Lines 253 to 271 in 628a6cb
Steps to Reproduce
Expected Result
connectorImp#resourceMetrics
is eventually cleaned up.Actual Result
connectorImp#resourceMetrics
keeps growing over time.Collector version
628a6cb
Environment information
Not relevant
OpenTelemetry Collector configuration
No response
Log output
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: