Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* GH-321: Add Observation propagation Fixes #321 * Start version `1.4` since this requires some API changes and upgrades * Upgrade to Reactor `3.5.3` for new context propagation API * Copy-paste (and adjust) `KafkaReceiverObservation` & `KafkaSenderObservation` infrastructure from Spring for Apache Kafka * Add an `Observation` handling into a `KafkaSender` with `contextCapture()` and `KafkaSenderObservation` around `producer.send()` * There is no yet automatic `Observation` handling on the consumer side since it is not clear how to handle each record transparently for end-user `Flux` downstream * The `ReactorKafkaObservationTests` demonstrates a single trace propagation from a sender via parent `Observation` and its restoration on a consumer side via `KafkaReceiverObservation` in the end-user code * * Fix Copyright date in the `build.gradle` * * Remove redundant code from the `ReactorKafkaObservationTests` * * Revert Reactor version * Revert new version `1.4` * Don't use `contextCapture()` in the `DefaultKafkaSender`: better to ask end-users to use a `contextWrite()` for the parent observation to propagate * `ReceiverObservations` factories to observe `ConsumerRecord` on the end-user side via `transformDeferred()` on each record * * Revert changes in the `DefaultKafkaSender` * * Upgrade dependencies * Fix deprecation in the `ConsumerHandler` for `eventScheduler.start()` * Use generated `producerId` and `receiverId` if `CLIENT_ID_CONFIG` is not provided * Use an `Observation` in the `DefaultKafkaReceiver` to add a `CONSUMER` span to the trace provided by the `PRODUCER` in the record. * Recommend to use a `KafkaReceiverObservation.RECEIVER_OBSERVATION` API directly in the target end-user code when need to have an observation context around record handling * * Revert `spotless` change in the `build.gradle` * * Some code clean up * Exclude `org.mockito` from Micrometer deps since we cannot use a newer version of Mockito yet * * Add trace log for received consumer record * * Fix conflicts after rebase * Add docs about observation support * * Fix language in docs Co-authored-by: Gary Russell <[email protected]> --------- Co-authored-by: Gary Russell <[email protected]>
- Loading branch information