Rework observability for Rabbit Binder (#2903)

Fixes: #2901 

* Rework an observation for Rabbit Binder

The observation propagation doesn't work in multi-binder configuration

* Remove `ObservationAutoConfiguration` since it is not visible in case of multi-binder configuration
* Instead move `setObservationEnabled` flag setting to the `RabbitMessageChannelBinder`
* Add `io.micrometer.observation.ObservationRegistry` into `shared.beans` to make it visible for binder-specific application context
* Add `RabbitMultiBinderObservationTests` integration test where Rabbit Binder is in a multi-binder environment

As a side effect, this fixes an observation propagation for the Kafka binder as well in the multi-binder environment.
Its configuration is OK, but an `ObservationRegistry` must make it visible for the binder-specific application context.
See the mentioned `shared. beans`

Related to https://github.com/spring-cloud/spring-cloud-stream/issues/2901
Also see https://github.com/spring-cloud/spring-cloud-stream/issues/2902 for possible evolution

* Update the copyright of the affected classes
This commit is contained in:
Artem Bilan
2024-02-14 18:53:06 -05:00
committed by GitHub
parent d620ff9838
commit 3e24d331db
8 changed files with 198 additions and 72 deletions

View File

@@ -13,3 +13,4 @@ org.springframework.cloud.stream.config.ProducerMessageHandlerCustomizer
org.springframework.cloud.stream.binder.test.InputDestination
org.springframework.cloud.stream.binder.test.OutputDestination
org.springframework.cloud.stream.config.BindingHandlerAdvise
io.micrometer.observation.ObservationRegistry