dapr / java-sdk

Dapr SDK for Java
Apache License 2.0
262 stars 207 forks source link

Add Micrometer Observation support to Spring Dapr Messaging #1150

Closed artur-ciocanu closed 3 weeks ago

artur-ciocanu commented 1 month ago

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:

artur-ciocanu commented 1 month ago

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

artur-ciocanu commented 1 month ago

@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!

salaboy commented 1 month ago

@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?

artur-ciocanu commented 1 month ago

@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 commented 3 weeks ago

@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!

salaboy commented 3 weeks ago

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

artur-ciocanu commented 3 weeks ago

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

Thank you!