From febca4aa5e2d1204789f240a048b6ff901397c46 Mon Sep 17 00:00:00 2001 From: Brian Clozel Date: Fri, 13 Jan 2023 11:56:36 +0100 Subject: [PATCH] Refer to external docs for observability support This commit removes the `KeyValues` listed in the Spring Boot reference documentation, since now support is implemented in Spring projects directly and documentation is maintained there. This change adds links to the relevant sections in the Spring Framework and Spring for GraphQL reference docs. --- .../src/docs/asciidoc/actuator/metrics.adoc | 114 +----------------- 1 file changed, 5 insertions(+), 109 deletions(-) diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/metrics.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/metrics.adoc index 2f8efb8500..ca37dd50df 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/metrics.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/metrics.adoc @@ -742,31 +742,12 @@ Metrics are tagged by the name of the executor, which is derived from the bean n [[actuator.metrics.supported.spring-mvc]] ==== Spring MVC Metrics + Auto-configuration enables the instrumentation of all requests handled by Spring MVC controllers and functional handlers. By default, metrics are generated with the name, `http.server.requests`. You can customize the name by setting the configprop:management.observations.http.server.requests.name[] property. -By default, Spring MVC related metrics are tagged with the following information: - -|=== -| Tag | Description - -| `exception` -| The simple class name of any exception that was thrown while handling the request. - -| `method` -| The request's method (for example, `GET` or `POST`) - -| `outcome` -| The request's outcome, based on the status code of the response. - 1xx is `INFORMATIONAL`, 2xx is `SUCCESS`, 3xx is `REDIRECTION`, 4xx is `CLIENT_ERROR`, and 5xx is `SERVER_ERROR` - -| `status` -| The response's HTTP status code (for example, `200` or `500`) - -| `uri` -| The request's URI template prior to variable substitution, if possible (for example, `/api/person/\{id}`) -|=== +See the {spring-framework-docs}/integration.html#integration.observability.http-server.servlet[Spring Framework reference documentation for more information on produced observations]. To add to the default tags, provide a `@Bean` that extends `DefaultServerRequestObservationConvention` from the `org.springframework.http.server.observation` package. To replace the default tags, provide a `@Bean` that implements `ServerRequestObservationConvention`. @@ -786,27 +767,7 @@ Auto-configuration enables the instrumentation of all requests handled by Spring By default, metrics are generated with the name, `http.server.requests`. You can customize the name by setting the configprop:management.observations.http.server.requests.name[] property. -By default, WebFlux related metrics are tagged with the following information: - -|=== -| Tag | Description - -| `exception` -| The simple class name of any exception that was thrown while handling the request. - -| `method` -| The request's method (for example, `GET` or `POST`) - -| `outcome` -| The request's outcome, based on the status code of the response. - 1xx is `INFORMATIONAL`, 2xx is `SUCCESS`, 3xx is `REDIRECTION`, 4xx is `CLIENT_ERROR`, and 5xx is `SERVER_ERROR` - -| `status` -| The response's HTTP status code (for example, `200` or `500`) - -| `uri` -| The request's URI template prior to variable substitution, if possible (for example, `/api/person/\{id}`) -|=== +See the {spring-framework-docs}/integration.html#integration.observability.http-server.reactive[Spring Framework reference documentation for more information on produced observations]. To add to the default tags, provide a `@Bean` that extends `DefaultServerRequestObservationConvention` from the `org.springframework.http.server.reactive.observation` package. To replace the default tags, provide a `@Bean` that implements `ServerRequestObservationConvention`. @@ -861,27 +822,7 @@ You can also manually apply the customizers responsible for this instrumentation By default, metrics are generated with the name, `http.client.requests`. You can customize the name by setting the configprop:management.observations.http.client.requests.name[] property. -By default, metrics generated by an instrumented client are tagged with the following information: - -|=== -| Tag | Description - -| `clientName` -| The host portion of the URI - -| `method` -| The request's method (for example, `GET` or `POST`) - -| `outcome` -| The request's outcome, based on the status code of the response. - 1xx is `INFORMATIONAL`, 2xx is `SUCCESS`, 3xx is `REDIRECTION`, 4xx is `CLIENT_ERROR`, and 5xx is `SERVER_ERROR`. Otherwise, it is `UNKNOWN`. - -| `status` -| The response's HTTP status code if available (for example, `200` or `500`) or `IO_ERROR` in case of I/O issues. Otherwise, it is `CLIENT_ERROR`. - -| `uri` -| The request's URI template prior to variable substitution, if possible (for example, `/api/person/\{id}`) -|=== +See the {spring-framework-docs}/integration.html#integration.observability.http-client[Spring Framework reference documentation for more information on produced observations]. To customize the tags when using `RestTemplate`, provide a `@Bean` that implements `ClientRequestObservationConvention` from the `org.springframework.http.client.observation` package. To customize the tags when using `WebClient`, provide a `@Bean` that implements `ClientRequestObservationConvention` from the `org.springframework.web.reactive.function.client` package. @@ -919,53 +860,8 @@ A `CacheMetricsRegistrar` bean is made available to make that process easier. [[actuator.metrics.supported.spring-graphql]] ==== Spring GraphQL Metrics -Auto-configuration enables the instrumentation of GraphQL queries, for any supported transport. -Spring Boot records a `graphql.request` timer with: - -[cols="1,2,2"] -|=== -|Tag | Description| Sample values - -|outcome -|Request outcome -|"SUCCESS", "ERROR" -|=== - -A single GraphQL query can involve many `DataFetcher` calls, so there is a dedicated `graphql.datafetcher` timer: - -[cols="1,2,2"] -|=== -|Tag | Description| Sample values - -|path -|data fetcher path -|"Query.project" - -|outcome -|data fetching outcome -|"SUCCESS", "ERROR" -|=== - - -The `graphql.request.datafetch.count` https://micrometer.io/docs/concepts#_distribution_summaries[distribution summary] counts the number of non-trivia -This metric is useful for detecting "N+1" data fetching issues and considering batch loading; it provides the `"TOTAL"` number of data fetcher calls ma -More options are available for <