Skip to content

Commit 0bf85af

Browse files
committed
Merge branch '6.0.x'
# Conflicts: # framework-docs/modules/ROOT/pages/integration/observability.adoc # spring-core/src/test/java/org/springframework/core/convert/converter/DefaultConversionServiceTests.java
2 parents 78bb66b + 826776f commit 0bf85af

File tree

2 files changed

+85
-95
lines changed

2 files changed

+85
-95
lines changed

framework-docs/modules/ROOT/pages/integration/observability.adoc

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
= Observability Support
33

44
Micrometer defines an https://micrometer.io/docs/observation[Observation concept that enables both Metrics and Traces] in applications.
5-
Metrics support offers a way to create timers, gauges or counters for collecting statistics about the runtime behavior of your application.
6-
Metrics can help you to track error rates, usage patterns, performance and more.
5+
Metrics support offers a way to create timers, gauges, or counters for collecting statistics about the runtime behavior of your application.
6+
Metrics can help you to track error rates, usage patterns, performance, and more.
77
Traces provide a holistic view of an entire system, crossing application boundaries; you can zoom in on particular user requests and follow their entire completion across applications.
88

99
Spring Framework instruments various parts of its own codebase to publish observations if an `ObservationRegistry` is configured.
@@ -39,16 +39,16 @@ https://micrometer.io/docs/concepts#_naming_meters[to the format preferred by th
3939
[[observability.concepts]]
4040
== Micrometer Observation concepts
4141

42-
If you are not familiar with Micrometer Observation, here's a quick summary of the new concepts you should know about.
42+
If you are not familiar with Micrometer Observation, here's a quick summary of the concepts you should know about.
4343

4444
* `Observation` is the actual recording of something happening in your application. This is processed by `ObservationHandler` implementations to produce metrics or traces.
4545
* Each observation has a corresponding `ObservationContext` implementation; this type holds all the relevant information for extracting metadata for it.
46-
In the case of an HTTP server observation, the context implementation could hold the HTTP request, the HTTP response, any Exception thrown during processing...
47-
* Each `Observation` holds `KeyValues` metadata. In the case of a server HTTP observation, this could be the HTTP request method, the HTTP response status...
46+
In the case of an HTTP server observation, the context implementation could hold the HTTP request, the HTTP response, any exception thrown during processing, and so forth.
47+
* Each `Observation` holds `KeyValues` metadata. In the case of an HTTP server observation, this could be the HTTP request method, the HTTP response status, and so forth.
4848
This metadata is contributed by `ObservationConvention` implementations which should declare the type of `ObservationContext` they support.
4949
* `KeyValues` are said to be "low cardinality" if there is a low, bounded number of possible values for the `KeyValue` tuple (HTTP method is a good example).
5050
Low cardinality values are contributed to metrics only.
51-
High cardinality values are on the other hand unbounded (for example, HTTP request URIs) and are only contributed to Traces.
51+
Conversely, "high cardinality" values are unbounded (for example, HTTP request URIs) and are only contributed to traces.
5252
* An `ObservationDocumentation` documents all observations in a particular domain, listing the expected key names and their meaning.
5353

5454

@@ -66,16 +66,16 @@ Each instrumented component will provide two extension points:
6666
=== Using custom Observation conventions
6767

6868
Let's take the example of the Spring MVC "http.server.requests" metrics instrumentation with the `ServerHttpObservationFilter`.
69-
This observation is using a `ServerRequestObservationConvention` with a `ServerRequestObservationContext`; custom conventions can be configured on the Servlet filter.
69+
This observation uses a `ServerRequestObservationConvention` with a `ServerRequestObservationContext`; custom conventions can be configured on the Servlet filter.
7070
If you would like to customize the metadata produced with the observation, you can extend the `DefaultServerRequestObservationConvention` for your requirements:
7171

7272
include-code::./ExtendedServerRequestObservationConvention[]
7373

74-
If you want full control, you can then implement the entire convention contract for the observation you're interested in:
74+
If you want full control, you can implement the entire convention contract for the observation you're interested in:
7575

7676
include-code::./CustomServerRequestObservationConvention[]
7777

78-
You can also achieve similar goals using a custom `ObservationFilter` - adding or removing key values for an observation.
78+
You can also achieve similar goals using a custom `ObservationFilter` adding or removing key values for an observation.
7979
Filters do not replace the default convention and are used as a post-processing component.
8080

8181
include-code::./ServerRequestObservationFilter[]
@@ -111,22 +111,22 @@ By default, the following `KeyValues` are created:
111111
[[observability.http-server]]
112112
== HTTP Server instrumentation
113113

114-
HTTP server exchanges observations are created with the name `"http.server.requests"` for Servlet and Reactive applications.
114+
HTTP server exchange observations are created with the name `"http.server.requests"` for Servlet and Reactive applications.
115115

116116
[[observability.http-server.servlet]]
117117
=== Servlet applications
118118

119119
Applications need to configure the `org.springframework.web.filter.ServerHttpObservationFilter` Servlet filter in their application.
120-
It is using the `org.springframework.http.server.observation.DefaultServerRequestObservationConvention` by default, backed by the `ServerRequestObservationContext`.
120+
It uses the `org.springframework.http.server.observation.DefaultServerRequestObservationConvention` by default, backed by the `ServerRequestObservationContext`.
121121

122-
This will only record an observation as an error if the `Exception` has not been handled by the web Framework and has bubbled up to the Servlet filter.
122+
This will only record an observation as an error if the `Exception` has not been handled by the web framework and has bubbled up to the Servlet filter.
123123
Typically, all exceptions handled by Spring MVC's `@ExceptionHandler` and xref:web/webmvc/mvc-ann-rest-exceptions.adoc[`ProblemDetail` support] will not be recorded with the observation.
124124
You can, at any point during request processing, set the error field on the `ObservationContext` yourself:
125125

126126
include-code::./UserController[]
127127

128128
NOTE: Because the instrumentation is done at the Servlet Filter level, the observation scope only covers the filters ordered after this one as well as the handling of the request.
129-
Typically, the Servlet container error handling is done at a lower level and won't have any active observation nor span.
129+
Typically, Servlet container error handling is performed at a lower level and won't have any active observation or span.
130130
For this use case, a container-specific implementation is required, such as a `org.apache.catalina.Valve` for Tomcat; this is outside of the scope of this project.
131131

132132
By default, the following `KeyValues` are created:
@@ -189,9 +189,9 @@ By default, the following `KeyValues` are created:
189189

190190

191191
[[observability.http-client]]
192-
== HTTP Client instrumentation
192+
== HTTP Client Instrumentation
193193

194-
HTTP client exchanges observations are created with the name `"http.client.requests"` for blocking and reactive clients.
194+
HTTP client exchange observations are created with the name `"http.client.requests"` for blocking and reactive clients.
195195
Unlike their server counterparts, the instrumentation is implemented directly in the client so the only required step is to configure an `ObservationRegistry` on the client.
196196

197197
[[observability.http-client.resttemplate]]
@@ -200,7 +200,7 @@ Unlike their server counterparts, the instrumentation is implemented directly in
200200
Applications must configure an `ObservationRegistry` on `RestTemplate` instances to enable the instrumentation; without that, observations are "no-ops".
201201
Spring Boot will auto-configure `RestTemplateBuilder` beans with the observation registry already set.
202202

203-
Instrumentation is using the `org.springframework.http.client.observation.ClientRequestObservationConvention` by default, backed by the `ClientRequestObservationContext`.
203+
Instrumentation uses the `org.springframework.http.client.observation.ClientRequestObservationConvention` by default, backed by the `ClientRequestObservationContext`.
204204

205205
.Low cardinality Keys
206206
[cols="a,a"]
@@ -229,7 +229,7 @@ Instrumentation is using the `org.springframework.http.client.observation.Client
229229
Applications must configure an `ObservationRegistry` on the `WebClient` builder to enable the instrumentation; without that, observations are "no-ops".
230230
Spring Boot will auto-configure `WebClient.Builder` beans with the observation registry already set.
231231

232-
Instrumentation is using the `org.springframework.web.reactive.function.client.ClientRequestObservationConvention` by default, backed by the `ClientRequestObservationContext`.
232+
Instrumentation uses the `org.springframework.web.reactive.function.client.ClientRequestObservationConvention` by default, backed by the `ClientRequestObservationContext`.
233233

234234
.Low cardinality Keys
235235
[cols="a,a"]

0 commit comments

Comments
 (0)