Skip to content

GH-3049: Listener exceptions are not saved to the observation. #3080

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

Merged
merged 3 commits into from
Feb 29, 2024

Conversation

Wzy19930507
Copy link
Contributor

  • Embedded the (original) exception into the observation, allowing downstream tracing code to handle it.
  • Add unit test for observation Error and RuntimeException.

Resolves #3049

@Wzy19930507
Copy link
Contributor Author

Unit text TransactionalContainerTests.testBatchListenerRecoverAfterRollbackProcessorCrash throw exception see #3081.

@Wzy19930507 Wzy19930507 changed the title Listener exceptions are not saved to the observation. GH-3049: Listener exceptions are not saved to the observation. Feb 28, 2024
KafkaTemplate<Integer, String> errorTemplate(ProducerFactory<Integer, String> pf) {
KafkaTemplate<Integer, String> template = new KafkaTemplate<>(pf);
template.setObservationEnabled(true);
return template;
Copy link
Member

Choose a reason for hiding this comment

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

Looks like both of these new KafkaTemplate beans are just exactly the same what is template bean.

Any particular reason why do we need these two?
Why that template is not enough for new tests?

Thanks

Copy link
Contributor Author

@Wzy19930507 Wzy19930507 Feb 29, 2024

Choose a reason for hiding this comment

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

Just for test tag spring.kafka.template.name, is doesn't matter.
Is ok to unify the runtimeExceptionTemplate and errorTemplate into a throwableTemplate?

* Embedded the (original) exception into the observation, allowing downstream tracing code to handle it.
* Add unit test for observation Error and RuntimeException.
@artembilan artembilan merged commit 61016db into spring-projects:main Feb 29, 2024
@Wzy19930507 Wzy19930507 deleted the GH-3049 branch March 1, 2024 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Listener exceptions not saved to the observation
2 participants