Sfoglia il codice sorgente

Fix Observability Opt-out Documentation Typo

Issue gh-12268
Josh Cummings 2 anni fa
parent
commit
c60c10792c

+ 2 - 2
docs/modules/ROOT/pages/reactive/integrations/observability.adoc

@@ -192,7 +192,7 @@ Instead, you can alter the provided `ObservationRegistry` with an `ObservationPr
 ----
 @Bean
 ObservationRegistryCustomizer<ObservationRegistry> noSpringSecurityObservations() {
-	ObservationPredicate predicate = (name, context) -> name.startsWith("spring.security.")
+	ObservationPredicate predicate = (name, context) -> !name.startsWith("spring.security.")
 	return (registry) -> registry.observationConfig().observationPredicate(predicate)
 }
 ----
@@ -202,7 +202,7 @@ ObservationRegistryCustomizer<ObservationRegistry> noSpringSecurityObservations(
 ----
 @Bean
 fun noSpringSecurityObservations(): ObservationRegistryCustomizer<ObservationRegistry> {
-	ObservationPredicate predicate = (name: String, context: Observation.Context) -> name.startsWith("spring.security.")
+	ObservationPredicate predicate = (name: String, context: Observation.Context) -> !name.startsWith("spring.security.")
 	(registry: ObservationRegistry) -> registry.observationConfig().observationPredicate(predicate)
 }
 ----

+ 2 - 2
docs/modules/ROOT/pages/servlet/integrations/observability.adoc

@@ -197,7 +197,7 @@ Instead, you can alter the provided `ObservationRegistry` with an `ObservationPr
 ----
 @Bean
 ObservationRegistryCustomizer<ObservationRegistry> noSpringSecurityObservations() {
-	ObservationPredicate predicate = (name, context) -> name.startsWith("spring.security.")
+	ObservationPredicate predicate = (name, context) -> !name.startsWith("spring.security.");
 	return (registry) -> registry.observationConfig().observationPredicate(predicate)
 }
 ----
@@ -207,7 +207,7 @@ ObservationRegistryCustomizer<ObservationRegistry> noSpringSecurityObservations(
 ----
 @Bean
 fun noSpringSecurityObservations(): ObservationRegistryCustomizer<ObservationRegistry> {
-	ObservationPredicate predicate = (name: String, context: Observation.Context) -> name.startsWith("spring.security.")
+	ObservationPredicate predicate = (name: String, context: Observation.Context) -> !name.startsWith("spring.security.")
 	(registry: ObservationRegistry) -> registry.observationConfig().observationPredicate(predicate)
 }
 ----