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

Clarify that memory limiter refuses data, doesn't drop it #7459

Conversation

tigrannajaryan
Copy link
Member

@tigrannajaryan tigrannajaryan commented Mar 31, 2023

Contributes to #1084

  • Clarify what the memory limiter does.
  • Set expectations from receivers, how they are supposed to react
    when the memory limiter refuses the data.
  • Add a test that demonstrates that memory limiter does not lose data
    if the receiver and exporter behave according to the contract.

All receivers must adhere to this contract. See for example
an issue opened against filelog receiver:
open-telemetry/opentelemetry-collector-contrib#20511

Note that there are no functional changes to the memory limiter.

Future work: one additional thing we can do is implement a backoff
logic in the memory limiter. When in memory limited mode the processor
can introduce pauses before it returns from the ConsumeLogs/Traces/Metrics
call. This will allow to slow down the inflow of data into the Collector
and give time for the pipeline to clear and memory usage to return to the
normal. This needs to be explored further.

@tigrannajaryan tigrannajaryan requested review from a team and codeboten March 31, 2023 15:28
@codecov
Copy link

codecov bot commented Mar 31, 2023

Codecov Report

Patch coverage: 96.10% and project coverage change: +0.04 🎉

Comparison is base (d4c25d4) 91.11% compared to head (5c617b7) 91.16%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7459      +/-   ##
==========================================
+ Coverage   91.11%   91.16%   +0.04%     
==========================================
  Files         292      294       +2     
  Lines       14205    14265      +60     
==========================================
+ Hits        12943    13004      +61     
  Misses        996      996              
+ Partials      266      265       -1     
Impacted Files Coverage Δ
processor/memorylimiterprocessor/config.go 0.00% <ø> (ø)
...r/memorylimiterprocessor/internal/mock_exporter.go 94.11% <94.11%> (ø)
processor/memorylimiterprocessor/memorylimiter.go 91.19% <94.11%> (+1.55%) ⬆️
...r/memorylimiterprocessor/internal/mock_receiver.go 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@tigrannajaryan tigrannajaryan added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Mar 31, 2023
@tigrannajaryan tigrannajaryan force-pushed the feature/tigran/memorylimiter branch 2 times, most recently from ba858b4 to a3c5432 Compare March 31, 2023 20:33
Contributes to open-telemetry#1084

- Clarify what the memory limiter does.
- Set expectations from receivers, how they are supposed to react
  when the memory limiter refuses the data.
- Add a test that demonstrates that memory limiter does not lose data
  if the receiver and exporter behave according to the contract.

All receivers must adhere to this contract. See for example
an issue opened against filelog receiver:
open-telemetry/opentelemetry-collector-contrib#20511

Note that there are no functional changes to the memory limiter.

Future work: one additional thing we can do is implement a backoff
logic in the memory limiter. When in memory limited mode the processor
can introduce pauses before it returns from the ConsumeLogs/Traces/Metrics
call. This will allow to slow down the inflow of data into the Collector
and give time for the pipeline to clear and memory usage to return to the
normal. This needs to be explored further.
@tigrannajaryan tigrannajaryan added the ready-to-merge Code review completed; ready to merge by maintainers label Apr 3, 2023
tigrannajaryan added a commit that referenced this pull request Apr 3, 2023
See discussion here #7459 (comment)

It is expected that the receivers should always retry, not just that they may retry.
dmitryax pushed a commit that referenced this pull request Apr 3, 2023
See discussion here #7459 (comment)

It is expected that the receivers should always retry, not just that they may retry.
pull bot pushed a commit to boost-entropy-golang/opentelemetry-collector that referenced this pull request Apr 3, 2023
…etry#7459)

Contributes to open-telemetry#1084

- Clarify what the memory limiter does.
- Set expectations from receivers, how they are supposed to react
  when the memory limiter refuses the data.
- Add a test that demonstrates that memory limiter does not lose data
  if the receiver and exporter behave according to the contract.

All receivers must adhere to this contract. See for example
an issue opened against filelog receiver:
open-telemetry/opentelemetry-collector-contrib#20511

Note that there are no functional changes to the memory limiter.

Future work: one additional thing we can do is implement a backoff
logic in the memory limiter. When in memory limited mode the processor
can introduce pauses before it returns from the ConsumeLogs/Traces/Metrics
call. This will allow to slow down the inflow of data into the Collector
and give time for the pipeline to clear and memory usage to return to the
normal. This needs to be explored further.
@dmitryax
Copy link
Member

dmitryax commented Apr 3, 2023

This PR was merged b1426af. Not sure why it's still open. Must be a GitHub glitch

@dmitryax dmitryax closed this Apr 3, 2023
@tigrannajaryan tigrannajaryan deleted the feature/tigran/memorylimiter branch April 3, 2023 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge Code review completed; ready to merge by maintainers Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants