From 1e2186296b006cd3e1873f8aa1e8fb07da2bb41c Mon Sep 17 00:00:00 2001 From: lcian Date: Tue, 11 Feb 2025 22:17:48 +0100 Subject: [PATCH] update --- sentry-reactor/README.md | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/sentry-reactor/README.md b/sentry-reactor/README.md index 8b164671b6..e3fed59145 100644 --- a/sentry-reactor/README.md +++ b/sentry-reactor/README.md @@ -1,21 +1,23 @@ # sentry-reactor -This module provides a set of utilities to manually instrument your application to send data to Sentry when using [Reactor](https://projectreactor.io/). +This module provides a set of utilities to use Sentry with [Reactor](https://projectreactor.io/). ## Setup Please refer to the documentation on how to set up our [Java SDK](https://docs.sentry.io/platforms/java/), or our [Spring](https://docs.sentry.io/platforms/java/guides/spring/) -or [Spring Boot](https://docs.sentry.io/platforms/java/guides/spring-boot/) integrations if you are using Spring WebFlux. +or [Spring Boot](https://docs.sentry.io/platforms/java/guides/spring-boot/) integrations if you're using Spring WebFlux. -If you're using our Spring Boot integration, this module will be available and set up automatically. +If you're using our Spring Boot integration, this module will be available and used under the hood to automatically instrument WebFlux. +If you're using our Spring integration, you need to configure WebFlux as we do in [SentryWebFluxAutoConfiguration](https://github.com/getsentry/sentry-java/blob/a5098280b52aec28c71c150e286b5c937767634d/sentry-spring-boot-jakarta/src/main/java/io/sentry/spring/boot/jakarta/SentryWebfluxAutoConfiguration.java) for Spring Boot. +Then, read on to the next section to find out how to use the utilities. -Otherwise, you'll need to perform the following steps to get started. +If you're not using Spring or Spring Boot, you'll need to perform the following steps to get started. -Add the latest version of `io.sentry.reactor` as a dependency. -Make sure you are using `io.micrometer:context-propagation:1.0.2` or later, provided by `io.projectreactor:reactor-core:3.5.3` or later. +Add the latest version of `io.sentry.reactor` as a dependency. +Make sure you're using `io.micrometer:context-propagation:1.0.2` or later, and `io.projectreactor:reactor-core:3.5.3` or later. -Then, enable automatic context propagation, which should happen as early as possible in your application lifecycle: +Then, enable automatic context propagation: ```java import reactor.core.publisher.Hooks; // ... @@ -43,17 +45,16 @@ ContextRegistry.getInstance().loadThreadLocalAccessors(); ## Usage -You can use the provided utilities to wrap `Mono` and `Flux` objects to enable correct errors, breadcrumbs and tracing reporting in your application. +You can use the utilities provided by this module to wrap `Mono` and `Flux` objects to enable correct errors, breadcrumbs and tracing in your application. For normal use cases, you should wrap your operations on `Mono` or `Flux` objects using the `withSentry` function. This will fork the *current scopes* and use them throughout the stream's execution context. -You can use the provided utilities to wrap `Mono` and `Flux` objects to enable correct error, breadcrumbs and tracing reporting for your reactive streams. +For more complex use cases, you can also use `withSentryForkedRoots` to fork the root scopes or `withSentryScopes` to wrap the operation in arbitrary scopes. -For more complex use cases, you can also use the `withSentryForkedRoots` to fork the root scopes or `withSentryScopes` to wrap the operation in arbitrary scopes. -For more information, you can consult our [scopes documentation](https://docs.sentry.io/platforms/java/enriching-events/scopes). +For more information on scopes and scope forking, please consult our [scopes documentation](https://docs.sentry.io/platforms/java/enriching-events/scopes). -Examples of usage of this module with Spring WebFlux are provided in +Examples of usage of this module with (Spring WebFlux) are provided in [sentry-samples-spring-boot-webflux](https://github.com/getsentry/sentry-java/tree/main/sentry-samples/sentry-samples-spring-boot-webflux) and [sentry-samples-spring-boot-webflux-jakarta](https://github.com/getsentry/sentry-java/tree/main/sentry-samples/sentry-samples-spring-boot-webflux-jakarta)