Commit b5941b9
committed
Make sure it is possible to override neo4jObservationCustomizer
At present, the `neo4jObservationCustomizer` has an effective `Ordered.LOWEST_PRECEDENCE`, meaning that it goes last in `Neo4jAutoConfiguration`:
```java
configBuilderCustomizers.orderedStream().toList()
...
customizers.forEach((customizer) -> customizer.customize(builder));
```
This update set its order to `Ordered.HIGHEST_PRECEDENCE`, meaning that a user-defined `ConfigBuilderCustomizer` can effectively override it.
As an example, this is useful when user wants to customize `MicrometerObservationProvider` as it actually has some optional properties that may be useful. Here is an example:
```java
@bean
ConfigBuilderCustomizer observationCustomizer(ObservationRegistry observationRegistry) {
return configBuilder -> {
var observationProvider = MicrometerObservationProvider.builder(observationRegistry)
.alwaysIncludeQuery(true)
.includeQueryParameters(true)
.includeUrlScheme(true)
.includeUrlTemplate(true)
.requestHeaderPredicate(name -> true)
.responseHeaderPredicate(name -> true)
.build();
configBuilder.withObservationProvider(observationProvider);
};
}
```1 parent 0c7e49e commit b5941b9
File tree
1 file changed
+3
-0
lines changed- module/spring-boot-neo4j/src/main/java/org/springframework/boot/neo4j/autoconfigure/observation
1 file changed
+3
-0
lines changedLines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
| |||
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
| 47 | + | |
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
| |||
0 commit comments