Instrument RestTemplate for Observability
This commit introduces Micrometer as an API dependency to the spring-web module. Micrometer is used here to instrument `RestTemplate` and record `Observation` for HTTP client exchanges. This will replace Spring Boot's `MetricsClientHttpRequestInterceptor` which uses the request interceptor contract for instrumentation. This approach is limited as measurements and tags aren't always precise and overhead is more important than a direct instrumentation. See gh-28341
This commit is contained in:
@@ -6,6 +6,7 @@ apply plugin: "kotlinx-serialization"
|
||||
dependencies {
|
||||
api(project(":spring-beans"))
|
||||
api(project(":spring-core"))
|
||||
api("io.micrometer:micrometer-observation")
|
||||
compileOnly("io.projectreactor.tools:blockhound")
|
||||
optional(project(":spring-aop"))
|
||||
optional(project(":spring-context"))
|
||||
@@ -74,6 +75,7 @@ dependencies {
|
||||
testImplementation("org.xmlunit:xmlunit-assertj")
|
||||
testImplementation("org.xmlunit:xmlunit-matchers")
|
||||
testImplementation("io.projectreactor.tools:blockhound")
|
||||
testImplementation("io.micrometer:micrometer-observation-test")
|
||||
testRuntimeOnly("com.sun.mail:jakarta.mail")
|
||||
testRuntimeOnly("com.sun.xml.bind:jaxb-core")
|
||||
testRuntimeOnly("com.sun.xml.bind:jaxb-impl")
|
||||
|
||||
Reference in New Issue
Block a user