-
Notifications
You must be signed in to change notification settings - Fork 2.9k
fix(kafkaexporter): Make Sarama's ConfigurationError as permanent to prevent retries #38608
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
fix(kafkaexporter): Make Sarama's ConfigurationError as permanent to prevent retries #38608
Conversation
3e2ada1
to
1577beb
Compare
If there a configuration error, should it not fail to start up? |
Reading the issue, it sounds like this should be part of the configuration validation step, not part of the execution. |
Unfortunately, it's impossible to validate size of a message upon configuration validation. The fact is that Sarama client produce such kind of error and this error should be processed by otelcol as a permanent as this is some kind idempotent state. |
if !errors.As(err, &producerErrs) || len(producerErrs) == 0 { | ||
return err | ||
} |
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.
My understanding of errors.As
is that will check that it was cast into the expected type, and work with the interface.
It shouldn't mutate the passed value.
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.
The errors.As
writes result to the second argument and returns boolean result of type casting. Thus it works with variable, not interface.
https://pkg.go.dev/errors#As
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.
Does my previous response clarify your concern?
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.
@MovieStoreGuy ping
Please address review and mark the PR as ready for review afterwards. |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
1577beb
to
d9c998a
Compare
return consumererror.NewPermanent(confErr) | ||
} | ||
|
||
return kafkaErrors{len(prodErr), prodErr[0].Err.Error()} |
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 feels like we are loosing some information performing this. I might follow up in a seperate PR.
…prevent retries (open-telemetry#38608) #### Description This fix unifies message send error handling for all types of telemetry. It is designed to identify whether the error was caused by a ConfigurationError and then reclassify it as a permanent consumer error to prevent further retries. #### Link to tracking issue open-telemetry#38604 #### Testing Unit test coverage added #### Documentation No changes Co-authored-by: Antoine Toulme <[email protected]> Co-authored-by: Sean Marciniak <[email protected]>
…prevent retries (open-telemetry#38608) #### Description This fix unifies message send error handling for all types of telemetry. It is designed to identify whether the error was caused by a ConfigurationError and then reclassify it as a permanent consumer error to prevent further retries. #### Link to tracking issue open-telemetry#38604 #### Testing Unit test coverage added #### Documentation No changes Co-authored-by: Antoine Toulme <[email protected]> Co-authored-by: Sean Marciniak <[email protected]>
Description
This fix unifies message send error handling for all types of telemetry. It is designed to identify whether the error was caused by a ConfigurationError and then reclassify it as a permanent consumer error to prevent further retries.
Link to tracking issue
#38604
Testing
Unit test coverage added
Documentation
No changes