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

[exporter/elasticsearch] Deprecate retry::max_requests in favor of retry::max_retries #35571

Merged
merged 9 commits into from
Oct 17, 2024

Conversation

carsonip
Copy link
Contributor

@carsonip carsonip commented Oct 3, 2024

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:

@carsonip carsonip marked this pull request as ready for review October 3, 2024 09:50
@carsonip carsonip requested a review from a team as a code owner October 3, 2024 09:51
@carsonip carsonip requested a review from MovieStoreGuy October 3, 2024 09:51
@carsonip carsonip requested a review from crobert-1 October 4, 2024 09:18
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")
Copy link
Member

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
Copy link
Contributor Author

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.

Copy link
Member

@andrzej-stencel andrzej-stencel left a 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 {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if cfg.Retry.MaxRequests > 0 && cfg.Retry.MaxRetries > 0 {
if cfg.Retry.MaxRequests != 0 && cfg.Retry.MaxRetries != 0 {

Copy link
Contributor Author

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

@andrzej-stencel andrzej-stencel merged commit 5b1b4d4 into open-telemetry:main Oct 17, 2024
158 checks passed
@github-actions github-actions bot added this to the next release milestone Oct 17, 2024
sbylica-splunk pushed a commit to sbylica-splunk/opentelemetry-collector-contrib that referenced this pull request Dec 17, 2024
…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.>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[exporter/elasticsearch] Clarify and decide retry.max_requests behavior
4 participants