@@ -43,19 +43,23 @@ static constexpr const char *kHttpRequestHeader = "http.request.header";
4343 <p>
4444 HTTP request method value SHOULD be "known" to the instrumentation.
4545 By default, this convention defines "known" methods as the ones listed in <a
46- href="https://www.rfc-editor.org/rfc/rfc9110.html#name-methods">RFC9110</a> and the PATCH method
47- defined in <a href="https://www.rfc-editor.org/rfc/rfc5789.html">RFC5789</a>. <p> If the HTTP
48- request method is not known to instrumentation, it MUST set the @code http.request.method @endcode
49- attribute to @code _OTHER @endcode. <p> If the HTTP instrumentation could end up converting valid
50- HTTP request methods to @code _OTHER @endcode, then it MUST provide a way to override the list of
51- known HTTP methods. If this override is done via environment variable, then the environment
52- variable MUST be named OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list
53- of case-sensitive known HTTP methods (this list MUST be a full override of the default known
54- method, it is not a list of known methods in addition to the defaults). <p> HTTP method names are
55- case-sensitive and @code http.request.method @endcode attribute value MUST match a known HTTP
56- method name exactly. Instrumentations for specific web frameworks that consider HTTP methods to be
57- case insensitive, SHOULD populate a canonical equivalent. Tracing instrumentations that do so,
58- MUST also set @code http.request.method_original @endcode to the original value.
46+ href="https://www.rfc-editor.org/rfc/rfc9110.html#name-methods">RFC9110</a>, the PATCH method
47+ defined in <a href="https://www.rfc-editor.org/rfc/rfc5789.html">RFC5789</a> and the QUERY method
48+ defined in <a
49+ href="https://datatracker.ietf.org/doc/draft-ietf-httpbis-safe-method-w-body/?include_text=1">httpbis-safe-method-w-body</a>.
50+ <p>
51+ If the HTTP request method is not known to instrumentation, it MUST set the @code
52+ http.request.method @endcode attribute to @code _OTHER @endcode. <p> If the HTTP instrumentation
53+ could end up converting valid HTTP request methods to @code _OTHER @endcode, then it MUST provide
54+ a way to override the list of known HTTP methods. If this override is done via environment
55+ variable, then the environment variable MUST be named OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and
56+ support a comma-separated list of case-sensitive known HTTP methods (this list MUST be a full
57+ override of the default known method, it is not a list of known methods in addition to the
58+ defaults). <p> HTTP method names are case-sensitive and @code http.request.method @endcode
59+ attribute value MUST match a known HTTP method name exactly. Instrumentations for specific web
60+ frameworks that consider HTTP methods to be case insensitive, SHOULD populate a canonical
61+ equivalent. Tracing instrumentations that do so, MUST also set @code http.request.method_original
62+ @endcode to the original value.
5963 */
6064static constexpr const char *kHttpRequestMethod = " http.request.method" ;
6165
@@ -97,11 +101,19 @@ static constexpr const char *kHttpResponseHeader = "http.response.header";
97101static constexpr const char *kHttpResponseStatusCode = " http.response.status_code" ;
98102
99103/* *
100- The matched route, that is, the path template in the format used by the respective server
101- framework. <p> MUST NOT be populated when this is not supported by the HTTP server framework as
102- the route attribute should have low-cardinality and the URI path can NOT substitute it. SHOULD
103- include the <a href="/docs/http/http-spans.md#http-server-definitions">application root</a> if
104- there is one.
104+ The matched route template for the request. This MUST be low-cardinality and include all static
105+ path segments, with dynamic path segments represented with placeholders. <p> MUST NOT be populated
106+ when this is not supported by the HTTP server framework as the route attribute should have
107+ low-cardinality and the URI path can NOT substitute it. SHOULD include the <a
108+ href="/docs/http/http-spans.md#http-server-definitions">application root</a> if there is one. <p>
109+ A static path segment is a part of the route template with a fixed, low-cardinality value. This
110+ includes literal strings like @code /users/ @endcode and placeholders that are constrained to a
111+ finite, predefined set of values, e.g. @code {controller} @endcode or @code {action} @endcode. <p>
112+ A dynamic path segment is a placeholder for a value that can have high cardinality and is not
113+ constrained to a predefined list like static path segments. <p> Instrumentations SHOULD use
114+ routing information provided by the corresponding web framework. They SHOULD pick the most precise
115+ source of routing information and MAY support custom route formatting. Instrumentations SHOULD
116+ document the format and the API used to obtain the route string.
105117 */
106118static constexpr const char *kHttpRoute = " http.route" ;
107119
0 commit comments