java-sdk icon indicating copy to clipboard operation
java-sdk copied to clipboard

Add Micrometer Observation support to Spring Dapr Messaging

Open artur-ciocanu opened this issue 1 year ago • 4 comments

Description

This PR adds support for Micrometer Observation into Spring Dapr Messaging. If everything goes well we will add similar support to Spring Dapr Data. This PR is heavily inspired and is a continuation of this PR: https://github.com/dapr/java-sdk/pull/1126.

In this PR I didn't enable any Project Reactor Hooks for context propagation. If we want to have context data being sent to OTEL or any other Micrometer exporter, this should be controlled by spring.reactor.context-propagation=auto Spring Boot application configuration. More details can be found here: https://docs.spring.io/spring-boot/reference/actuator/observability.html.

Issue reference

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #1149

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • [x] Code compiles correctly
  • [x] Created/updated tests
  • [ ] Extended the documentation

artur-ciocanu avatar Oct 19 '24 09:10 artur-ciocanu

@artursouza @cicoyle and @salaboy when you have a chance could you please take a look. Thank you!

artur-ciocanu avatar Oct 19 '24 10:10 artur-ciocanu

@salaboy I would really appreciate if you could take this PR for "a ride" using this "spring.reactor.context-propagation=auto" Spring Boot configuration to see if traces land in Zipkin or any other tool that you played with in this PR: https://github.com/dapr/java-sdk/pull/1126.

Thanks in advance!

artur-ciocanu avatar Oct 19 '24 10:10 artur-ciocanu

@artur-ciocanu I will check it out.. So.. this PR is following what I did on my PR, but not adding this -> https://github.com/dapr/java-sdk/pull/1126/files#diff-f86931381933e4ae24b3f860afc7618f23aecb516cea8bfd0ce627b16bf64e19R100 which is enabled by the property: spring.reactor.context-propagation=auto , am I right? are there any other significant changes?

salaboy avatar Oct 19 '24 10:10 salaboy

@artur-ciocanu I will check it out.. So.. this PR is following what I did on my PR, but not adding this -> https://github.com/dapr/java-sdk/pull/1126/files#diff-f86931381933e4ae24b3f860afc7618f23aecb516cea8bfd0ce627b16bf64e19R100 which is enabled by the property: spring.reactor.context-propagation=auto , am I right? are there any other significant changes?

Exactly, since this is intended to be used in a Spring Boot environment, it is better to have this controlled via application configuration/properties and not enable it in the Dapr Messaging component.

artur-ciocanu avatar Oct 19 '24 10:10 artur-ciocanu

@artursouza or @cicoyle I have made a few changes based on @salaboy suggestions. Could you please re-trigger the build, there is an IT test that failed, but it is not related to my changes.

Thank you!

artur-ciocanu avatar Nov 03 '24 19:11 artur-ciocanu

@artur-ciocanu I've just tested this PR it is good to merge.. @cicoyle @artursouza

salaboy avatar Nov 04 '24 10:11 salaboy

@artursouza and @cicoyle, since we have green light from @salaboy, could you please review, approve and merge.

Thank you!

artur-ciocanu avatar Nov 04 '24 22:11 artur-ciocanu