Currently, we lack observability to detect errors when using the Standalone Producer. This pull request introduces improvements to error handling and instrumentation in standalone producer. The primary goal is to enhance visibility into producer errors. It's using delivery callback to instrument events for both successful and failed deliveries.
Here are stats and exceptions in various scenarios
NOTE: In some cases there error is instrumented twice, once via delivery callback and once via exception handling, for example using sync producer with invalid partition. This happens with sync because handle.wait raises an error, and delivery callback also reports the error.
Currently, we lack observability to detect errors when using the Standalone Producer. This pull request introduces improvements to error handling and instrumentation in standalone producer. The primary goal is to enhance visibility into producer errors. It's using delivery callback to instrument events for both successful and failed deliveries.
Here are stats and exceptions in various scenarios
NOTE: In some cases there error is instrumented twice, once via delivery callback and once via exception handling, for example using sync producer with invalid partition. This happens with sync because handle.wait raises an error, and delivery callback also reports the error.