Skip to content

elasticsearchexporter: Introduce LRU cache for profiles #38606

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

Merged
merged 36 commits into from
Apr 17, 2025

Conversation

dmathieu
Copy link
Member

Description

This introduces an LRU cache for profiles, so we don't overwhelm Elasticsearch with duplicate documents.

@dmathieu dmathieu marked this pull request as ready for review March 13, 2025 14:52
@dmathieu dmathieu requested a review from a team as a code owner March 13, 2025 14:52
@dmathieu dmathieu requested a review from atoulme March 13, 2025 14:52
@rockdaboot
Copy link
Contributor

Maybe we can merge #38577 before this PR, as it adds two more items to Payload that need to be cached: UnsymbolizedLeafFrames and UnsymbolizedExecutables. Or we add those caches in a follow-up PR.

@dmathieu
Copy link
Member Author

Let's do yours first.

@dmathieu dmathieu marked this pull request as draft March 17, 2025 09:05
atoulme pushed a commit that referenced this pull request Mar 25, 2025
…der (#38732)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

For
#38606,
we want to be able to store state within the otel encoder.
We can't do that, as we encoder is root methods, not within a struct.

So this PR changes that behavior to keep encoders in memory, so they can
introduce shared state such as cache.
@dmathieu dmathieu force-pushed the profiles-cache branch 3 times, most recently from f6fb14e to 1a972e1 Compare March 26, 2025 12:25
@dmathieu dmathieu marked this pull request as ready for review March 26, 2025 14:08
@dmathieu
Copy link
Member Author

This is ready for review again.

carsonip
carsonip approved these changes Apr 11, 2025
@andrzej-stencel
Copy link
Member

Hopefully #39452 will fix the CI.

@crobert-1 crobert-1 added ready to merge Code review completed; ready to merge by maintainers and removed waiting-for-code-owners labels Apr 16, 2025
@atoulme atoulme merged commit b4b41b9 into open-telemetry:main Apr 17, 2025
189 checks passed
@github-actions github-actions bot added this to the next release milestone Apr 17, 2025
@dmathieu dmathieu deleted the profiles-cache branch April 17, 2025 07:27
akshays-19 pushed a commit to akshays-19/opentelemetry-collector-contrib that referenced this pull request Apr 23, 2025
…ry#38606)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

This introduces an LRU cache for profiles, so we don't overwhelm
Elasticsearch with duplicate documents.

---------

Co-authored-by: Tim Rühsen <[email protected]>
Co-authored-by: Carson Ip <[email protected]>
Fiery-Fenix pushed a commit to Fiery-Fenix/opentelemetry-collector-contrib that referenced this pull request Apr 24, 2025
…der (open-telemetry#38732)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

For
open-telemetry#38606,
we want to be able to store state within the otel encoder.
We can't do that, as we encoder is root methods, not within a struct.

So this PR changes that behavior to keep encoders in memory, so they can
introduce shared state such as cache.
Fiery-Fenix pushed a commit to Fiery-Fenix/opentelemetry-collector-contrib that referenced this pull request Apr 24, 2025
…ry#38606)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

This introduces an LRU cache for profiles, so we don't overwhelm
Elasticsearch with duplicate documents.

---------

Co-authored-by: Tim Rühsen <[email protected]>
Co-authored-by: Carson Ip <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exporter/elasticsearch ready to merge Code review completed; ready to merge by maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants