-
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
[exporter/elasticsearch] Deprecate retry::max_requests in favor of retry::max_retries #35571
Conversation
if cfg.Mapping.Dedup != nil { | ||
logger.Warn("dedup is deprecated, and is always enabled") | ||
} | ||
if cfg.Mapping.Dedot && cfg.MappingMode() != MappingECS || !cfg.Mapping.Dedot && cfg.MappingMode() == MappingECS { | ||
logger.Warn("dedot has been deprecated: in the future, dedotting will always be performed in ECS mode only") | ||
} | ||
if cfg.Retry.MaxRequests != 0 { | ||
if cfg.Retry.MaxRetries != 0 { | ||
return errors.New("should specify at most one of retry::max_requests and retry::max_retries") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This must be checked in the Config::Validate()
method, so that the validate
command checks it.
@@ -50,27 +50,34 @@ type bulkIndexerSession interface { | |||
Flush(context.Context) error | |||
} | |||
|
|||
const defaultMaxRetries = 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[to reviewer] moving default out of default config, otherwise we cannot detect max_requests !=0 and max_retries != 0 due to default config being initialized first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a small nit that maybe can be fixed in a follow-up PR
@@ -280,6 +280,9 @@ func (cfg *Config) Validate() error { | |||
if cfg.Retry.MaxRetries < 0 { | |||
return errors.New("retry::max_retries should be non-negative") | |||
} | |||
if cfg.Retry.MaxRequests > 0 && cfg.Retry.MaxRetries > 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if cfg.Retry.MaxRequests > 0 && cfg.Retry.MaxRetries > 0 { | |
if cfg.Retry.MaxRequests != 0 && cfg.Retry.MaxRetries != 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦 I did exactly that but forgot to push
…try::max_retries (open-telemetry#35571) **Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> The new retry::max_retries will be exactly retry::max_requests - 1, but it will be much more intuitive to the end user. Deprecate retry::max_requests. **Link to tracking Issue:** <Issue number if applicable> Fixes open-telemetry#32344 **Testing:** <Describe what testing was performed and which tests were added.> **Documentation:** <Describe the documentation added.>
Description:
The new retry::max_retries will be exactly retry::max_requests - 1, but it will be much more intuitive to the end user. Deprecate retry::max_requests.
Link to tracking Issue:
Fixes #32344
Testing:
Documentation: