You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/attributes-registry/url.md
+1
Original file line number
Diff line number
Diff line change
@@ -23,6 +23,7 @@ Attributes describing URL.
23
23
|`url.registered_domain`| string | The highest registered url domain, stripped of the subdomain. [7]|`example.com`; `foo.co.uk`||
24
24
|`url.scheme`| string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. |`https`; `ftp`; `telnet`||
25
25
|`url.subdomain`| string | The subdomain portion of a fully qualified domain name includes all of the names except the host name under the registered_domain. In a partially qualified domain, or if the qualification level of the full name cannot be determined, subdomain contains all of the names below the registered domain. [8]|`east`; `sub2.sub1`||
26
+
|`url.template`| string | The low-cardinality template of an [absolute path reference](https://www.rfc-editor.org/rfc/rfc3986#section-4.2). |`/users/{id}`; `/users/:id`; `/users?id={id}`||
26
27
|`url.top_level_domain`| string | The effective top level domain (eTLD), also known as the domain suffix, is the last part of the domain name. For example, the top level domain for example.com is `com`. [9]|`com`; `co.uk`||
27
28
28
29
**[1]:** In some cases a URL may refer to an IP and/or port directly, without a domain name. In this case, the IP address would go to the domain field. If the URL contains a [literal IPv6 address](https://www.rfc-editor.org/rfc/rfc2732#section-2) enclosed by `[` and `]`, the `[` and `]` characters should also be captured in the domain field.
@@ -514,6 +515,20 @@ If the request has completed successfully, instrumentations SHOULD NOT set `erro
514
515
|`_OTHER`| A fallback error value to be used when the instrumentation doesn't define a custom value. ||
515
516
<!-- endsemconv -->
516
517
518
+
#### Experimental attributes
519
+
520
+
**Status**: [Experimental][DocumentStatus]
521
+
522
+
Instrumentations MAY allow users to enable additional experimental attributes.
|[`url.template`](/docs/attributes-registry/url.md)| string | The low-cardinality template of an [absolute path reference](https://www.rfc-editor.org/rfc/rfc3986#section-4.2). [1]|`/users/{id}`; `/users/:id`; `/users?id={id}`|`Opt-In`||
528
+
529
+
**[1]:** The `url.template` MUST have low cardinality. It is not usually available on HTTP clients, but may be known by the application or specialized HTTP instrumentation.
530
+
<!-- endsemconv -->
531
+
517
532
### Metric: `http.client.request.body.size`
518
533
519
534
This metric is optional.
@@ -535,7 +550,8 @@ This metric is optional.
535
550
|[`error.type`](/docs/attributes-registry/error.md)| string | Describes a class of error the operation ended with. [4]|`timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500`|`Conditionally Required` If request has ended with an error. ||
536
551
|[`http.response.status_code`](/docs/attributes-registry/http.md)| int |[HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). |`200`|`Conditionally Required` If and only if one was received/sent. ||
|[`network.protocol.version`](/docs/attributes-registry/network.md)| string | The actual version of the protocol used for network communication. [7]|`1.0`; `1.1`; `2`; `3`|`Recommended`||
553
+
|[`url.template`](/docs/attributes-registry/url.md)| string | The low-cardinality template of an [absolute path reference](https://www.rfc-editor.org/rfc/rfc3986#section-4.2). [7]|`/users/{id}`; `/users/:id`; `/users?id={id}`|`Conditionally Required` If available. ||
554
+
|[`network.protocol.version`](/docs/attributes-registry/network.md)| string | The actual version of the protocol used for network communication. [8]|`1.0`; `1.1`; `2`; `3`|`Recommended`||
539
555
|[`url.scheme`](/docs/attributes-registry/url.md)| string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. |`http`; `https`|`Opt-In`||
540
556
541
557
**[1]:** HTTP request method value SHOULD be "known" to the instrumentation.
@@ -578,7 +594,9 @@ If the request has completed successfully, instrumentations SHOULD NOT set `erro
578
594
579
595
**[6]:** If not `http` and `network.protocol.version` is set.
580
596
581
-
**[7]:** If protocol version is subject to negotiation (for example using [ALPN](https://www.rfc-editor.org/rfc/rfc7301.html)), this attribute SHOULD be set to the negotiated version. If the actual protocol version is not known, this attribute SHOULD NOT be set.
597
+
**[7]:** The `url.template` MUST have low cardinality. It is not usually available on HTTP clients, but may be known by the application or specialized HTTP instrumentation.
598
+
599
+
**[8]:** If protocol version is subject to negotiation (for example using [ALPN](https://www.rfc-editor.org/rfc/rfc7301.html)), this attribute SHOULD be set to the negotiated version. If the actual protocol version is not known, this attribute SHOULD NOT be set.
582
600
583
601
`http.request.method` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
584
602
@@ -623,7 +641,8 @@ This metric is optional.
623
641
|[`error.type`](/docs/attributes-registry/error.md)| string | Describes a class of error the operation ended with. [4]|`timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500`|`Conditionally Required` If request has ended with an error. ||
624
642
|[`http.response.status_code`](/docs/attributes-registry/http.md)| int |[HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). |`200`|`Conditionally Required` If and only if one was received/sent. ||
|[`network.protocol.version`](/docs/attributes-registry/network.md)| string | The actual version of the protocol used for network communication. [7]|`1.0`; `1.1`; `2`; `3`|`Recommended`||
644
+
|[`url.template`](/docs/attributes-registry/url.md)| string | The low-cardinality template of an [absolute path reference](https://www.rfc-editor.org/rfc/rfc3986#section-4.2). [7]|`/users/{id}`; `/users/:id`; `/users?id={id}`|`Conditionally Required` If available. ||
645
+
|[`network.protocol.version`](/docs/attributes-registry/network.md)| string | The actual version of the protocol used for network communication. [8]|`1.0`; `1.1`; `2`; `3`|`Recommended`||
627
646
|[`url.scheme`](/docs/attributes-registry/url.md)| string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. |`http`; `https`|`Opt-In`||
628
647
629
648
**[1]:** HTTP request method value SHOULD be "known" to the instrumentation.
@@ -666,7 +685,9 @@ If the request has completed successfully, instrumentations SHOULD NOT set `erro
666
685
667
686
**[6]:** If not `http` and `network.protocol.version` is set.
668
687
669
-
**[7]:** If protocol version is subject to negotiation (for example using [ALPN](https://www.rfc-editor.org/rfc/rfc7301.html)), this attribute SHOULD be set to the negotiated version. If the actual protocol version is not known, this attribute SHOULD NOT be set.
688
+
**[7]:** The `url.template` MUST have low cardinality. It is not usually available on HTTP clients, but may be known by the application or specialized HTTP instrumentation.
689
+
690
+
**[8]:** If protocol version is subject to negotiation (for example using [ALPN](https://www.rfc-editor.org/rfc/rfc7301.html)), this attribute SHOULD be set to the negotiated version. If the actual protocol version is not known, this attribute SHOULD NOT be set.
670
691
671
692
`http.request.method` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
672
693
@@ -771,14 +792,17 @@ This metric is optional.
771
792
|---|---|---|---|---|---|
772
793
|[`server.address`](/docs/attributes-registry/server.md)| string | Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. [1]|`example.com`; `10.1.2.80`; `/tmp/my.sock`|`Required`||
773
794
|[`server.port`](/docs/attributes-registry/server.md)| int | Port identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. [2]|`80`; `8080`; `443`|`Required`||
|[`url.template`](/docs/attributes-registry/url.md)| string | The low-cardinality template of an [absolute path reference](https://www.rfc-editor.org/rfc/rfc3986#section-4.2). [3]|`/users/{id}`; `/users/:id`; `/users?id={id}`|`Conditionally Required` If available. ||
|[`url.scheme`](/docs/attributes-registry/url.md)| string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. |`http`; `https`|`Opt-In`||
776
798
777
799
**[1]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available.
778
800
779
801
**[2]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available.
780
802
781
-
**[3]:** HTTP request method value SHOULD be "known" to the instrumentation.
803
+
**[3]:** The `url.template` MUST have low cardinality. It is not usually available on HTTP clients, but may be known by the application or specialized HTTP instrumentation.
804
+
805
+
**[4]:** HTTP request method value SHOULD be "known" to the instrumentation.
782
806
By default, this convention defines "known" methods as the ones listed in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods)
783
807
and the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html).
Copy file name to clipboardexpand all lines: docs/http/http-spans.md
+13-12
Original file line number
Diff line number
Diff line change
@@ -68,25 +68,23 @@ and various HTTP versions like 1.1, 2 and SPDY.
68
68
69
69
HTTP spans MUST follow the overall [guidelines for span names](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.31.0/specification/trace/api.md#span).
70
70
71
+
HTTP span names SHOULD be `{method} {target}` if there is a (low-cardinality) `target` available. If there is no (low-cardinality) `{target}` available, HTTP span names SHOULD be `{method}`.
72
+
71
73
<!-- markdown-link-check-disable -->
72
74
<!-- HTML anchors are not supported https://github.com/tcort/markdown-link-check/issues/225-->
73
-
HTTP server span names SHOULD be `{method} {http.route}` if there is a
74
-
(low-cardinality) `http.route` available (see below for the exact definition of the [`{method}`](#method-placeholder) placeholder).
75
-
76
-
If there is no (low-cardinality) `http.route` available, HTTP server span names
77
-
SHOULD be [`{method}`](#method-placeholder).
78
-
79
-
HTTP client spans have no `http.route` attribute since client-side instrumentation
80
-
is not generally aware of the "route", and therefore HTTP client span names SHOULD be
81
-
[`{method}`](#method-placeholder).
75
+
(see below for the exact definition of the [`{method}`](#method-placeholder) and [`{target}`](#target-placeholder) placeholders).
82
76
<!-- markdown-link-check-enable -->
83
77
84
78
The <spanid="method-placeholder">`{method}`</span> MUST be `{http.request.method}` if the method represents the original method known to the instrumentation.
85
79
In other cases (when `{http.request.method}` is set to `_OTHER`), `{method}` MUST be `HTTP`.
86
80
87
-
Instrumentation MUST NOT default to using URI
88
-
path as span name, but MAY provide hooks to allow custom logic to override the
89
-
default span name.
81
+
The <spanid="target-placeholder">`{target}`</span> SHOULD be one of the following:
82
+
83
+
-[`http.route`](/docs/attributes-registry/http.md) for HTTP Server spans
84
+
-[`url.template`](/docs/attributes-registry/url.md) for HTTP Client spans if enabled and available ()
85
+
- Other value MAY be provided through custom hooks at span start time or later.
86
+
87
+
Instrumentation MUST NOT default to using URI path as a `{target}`.
90
88
91
89
## Status
92
90
@@ -255,6 +253,9 @@ Instrumentations MAY allow users to enable additional experimental attributes.
255
253
|[`http.request.size`](/docs/attributes-registry/http.md)| int | The total size of the request in bytes. This should be the total number of bytes sent over the wire, including the request line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, and request body if any. |`1437`|`Opt-In`||
256
254
|[`http.response.body.size`](/docs/attributes-registry/http.md)| int | The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. |`3495`|`Opt-In`||
257
255
|[`http.response.size`](/docs/attributes-registry/http.md)| int | The total size of the response in bytes. This should be the total number of bytes sent over the wire, including the status line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, and response body and trailers if any. |`1437`|`Opt-In`||
256
+
|[`url.template`](/docs/attributes-registry/url.md)| string | The low-cardinality template of an [absolute path reference](https://www.rfc-editor.org/rfc/rfc3986#section-4.2). [1]|`/users/{id}`; `/users/:id`; `/users?id={id}`|`Opt-In`||
257
+
258
+
**[1]:** The `url.template` MUST have low cardinality. It is not usually available on HTTP clients, but may be known by the application or specialized HTTP instrumentation.
Copy file name to clipboardexpand all lines: model/http-common.yaml
+9
Original file line number
Diff line number
Diff line change
@@ -56,6 +56,15 @@ groups:
56
56
requirement_level: opt_in
57
57
examples: ["http", "https"]
58
58
59
+
- id: attributes.http.client.experimental
60
+
type: attribute_group
61
+
brief: "Experimental HTTP attributes."
62
+
attributes:
63
+
- ref: url.template
64
+
requirement_level: opt_in
65
+
note: >
66
+
The `url.template` MUST have low cardinality. It is not usually available on HTTP clients, but may be known by the application or specialized HTTP instrumentation.
0 commit comments