Skip to content

Commit 208bb48

Browse files
committed
Document OpenTelemetry HTTP server convention
Closes gh-35358
1 parent 7e45f60 commit 208bb48

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

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

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,13 +189,13 @@ This observation uses the `io.micrometer.jakarta9.instrument.jms.DefaultJmsProce
189189
[[observability.http-server]]
190190
== HTTP Server instrumentation
191191

192-
HTTP server exchange observations are created with the name `"http.server.requests"` for Servlet and Reactive applications.
192+
HTTP server exchange observations are created with the name `"http.server.requests"` for Servlet and Reactive applications,
193+
or "http.server.request.duration" if using the OpenTelemetry convention.
193194

194195
[[observability.http-server.servlet]]
195196
=== Servlet applications
196197

197198
Applications need to configure the `org.springframework.web.filter.ServerHttpObservationFilter` Servlet filter in their application.
198-
It uses the `org.springframework.http.server.observation.DefaultServerRequestObservationConvention` by default, backed by the `ServerRequestObservationContext`.
199199

200200
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.
201201
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.
@@ -207,6 +207,11 @@ NOTE: Because the instrumentation is done at the Servlet Filter level, the obser
207207
Typically, Servlet container error handling is performed at a lower level and won't have any active observation or span.
208208
For this use case, a container-specific implementation is required, such as a `org.apache.catalina.Valve` for Tomcat; this is outside the scope of this project.
209209

210+
[[observability.http-server.servlet.default]]
211+
==== Default Semantic Convention
212+
213+
It uses the `org.springframework.http.server.observation.DefaultServerRequestObservationConvention` by default, backed by the `ServerRequestObservationContext`.
214+
210215
By default, the following `KeyValues` are created:
211216

212217
.Low cardinality Keys
@@ -228,6 +233,16 @@ By default, the following `KeyValues` are created:
228233
|`http.url` _(required)_|HTTP request URI.
229234
|===
230235

236+
237+
[[observability.http-server.servlet.otel]]
238+
==== OpenTelemetry Semantic Convention
239+
240+
An OpenTelemetry variant is available with `org.springframework.http.server.observation.OpenTelemetryServerRequestObservationConvention`, backed by the `ServerRequestObservationContext`.
241+
242+
This variant complies with the https://github.com/open-telemetry/semantic-conventions/blob/v1.36.0/docs/http/http-metrics.md[OpenTelemetry Semantic Conventions for HTTP Metrics (v1.36.0)]
243+
and the https://github.com/open-telemetry/semantic-conventions/blob/v1.36.0/docs/http/http-spans.md[OpenTelemetry Semantic Conventions for HTTP Spans (v1.36.0)].
244+
245+
231246
[[observability.http-server.reactive]]
232247
=== Reactive applications
233248

0 commit comments

Comments
 (0)