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

GH-2817: KafkaTemplate: No double error timers #2823

Merged
merged 2 commits into from
Sep 25, 2023

Conversation

artembilan
Copy link
Member

Fixes #2817

An observation in KafkaTemplate can be marked with error from a Callback. Then Future is evaluated and its exception is thrown back to the observeSend(). Here this exception is caught and reported to the observation again. This creates a second timer in the Micrometer, but with different error tag

  • Check for error presence in the observeSend() catch block and skip second report

Cherry-pick to 3.0.x

Fixes spring-projects#2817

An observation in `KafkaTemplate` can be marked with error from a `Callback`.
Then `Future` is evaluated and its exception is thrown back to the `observeSend()`.
Here this exception is caught and reported to the observation again.
This creates a second timer in the Micrometer, but with different error tag

* Check for error presence in the `observeSend()` `catch` block and skip
second report

**Cherry-pick to `3.0.x`**
@garyrussell garyrussell merged commit b212b4d into spring-projects:main Sep 25, 2023
garyrussell pushed a commit that referenced this pull request Sep 25, 2023
* GH-2817: KafkaTemplate: No double error timers

Fixes #2817

An observation in `KafkaTemplate` can be marked with error from a `Callback`.
Then `Future` is evaluated and its exception is thrown back to the `observeSend()`.
Here this exception is caught and reported to the observation again.
This creates a second timer in the Micrometer, but with different error tag

* Check for error presence in the `observeSend()` `catch` block and skip
second report

**Cherry-pick to `3.0.x`**

* * Fix import order for Checkstyle rule
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants