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

[processor/memory_limiter] Update config validation #9059

Conversation

dmitryax
Copy link
Member

  • Fix names of the config fields that are validated in the error messages
  • Move the validation from start to the initialization phrase

@dmitryax dmitryax requested a review from a team as a code owner December 10, 2023 23:42
@dmitryax dmitryax force-pushed the update-memory-limiter-config-validation branch from a35678d to 1fb41fc Compare December 10, 2023 23:43
@dmitryax dmitryax changed the title [processor/memory_limiter] Update config validation errors [processor/memory_limiter] Update config validation Dec 10, 2023
Copy link

codecov bot commented Dec 10, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b0f618e) 91.49% compared to head (78ad81b) 91.42%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9059      +/-   ##
==========================================
- Coverage   91.49%   91.42%   -0.08%     
==========================================
  Files         316      316              
  Lines       17181    17185       +4     
==========================================
- Hits        15720    15711       -9     
- Misses       1165     1173       +8     
- Partials      296      301       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

  - Fix names of the config fields that are validated in the error messages
  - Move the validation from start to the initialization phrase
Comment on lines -38 to +46
"checkInterval must be greater than zero")
errCheckIntervalOutOfRange = errors.New("check_interval must be greater than zero")

errLimitOutOfRange = errors.New(
"memAllocLimit or memoryLimitPercentage must be greater than zero")
errLimitOutOfRange = errors.New("limit_mib or limit_percentage must be greater than zero")

errMemSpikeLimitOutOfRange = errors.New(
"memSpikeLimit must be smaller than memAllocLimit")
errMemSpikeLimitOutOfRange = errors.New("spike_limit_mib must be smaller than limit_mib")

errMemSpikePercentageLimitOutOfRange = errors.New("spike_limit_percentage must be smaller than limit_percentage")

errPercentageLimitOutOfRange = errors.New(
"memoryLimitPercentage and memorySpikePercentage must be greater than zero and less than or equal to hundred",
)
"limit_percentage and spike_limit_percentage must be greater than zero and less than or equal to hundred")
Copy link
Member

Choose a reason for hiding this comment

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

Move them to config.go?

@bogdandrutu bogdandrutu merged commit b81d4ef into open-telemetry:main Dec 12, 2023
32 checks passed
@github-actions github-actions bot added this to the next release milestone Dec 12, 2023
@dmitryax dmitryax deleted the update-memory-limiter-config-validation branch December 13, 2023 08:57
sokoide pushed a commit to sokoide/opentelemetry-collector that referenced this pull request Dec 18, 2023
)

- Fix names of the config fields that are validated in the error
messages
  - Move the validation from start to the initialization phrase
sokoide pushed a commit to sokoide/opentelemetry-collector that referenced this pull request Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants