-
Notifications
You must be signed in to change notification settings - Fork 896
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING: Introduce common
url.*
attributes, and improve use of nam…
…espacing under `http.*` (#3355)
- Loading branch information
Showing
16 changed files
with
257 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
groups: | ||
- id: attributes.http.deprecated | ||
type: attribute_group | ||
brief: "Describes deprecated HTTP attributes." | ||
prefix: http | ||
attributes: | ||
- id: method | ||
type: string | ||
brief: 'Deprecated, use `http.request.method` instead.' | ||
stability: deprecated | ||
examples: ["GET", "POST", "HEAD"] | ||
- id: status_code | ||
type: int | ||
brief: 'Deprecated, use `http.response.status_code` instead.' | ||
stability: deprecated | ||
examples: [200] | ||
- id: scheme | ||
type: string | ||
brief: 'Deprecated, use `url.scheme` instead.' | ||
stability: deprecated | ||
examples: ['http', 'https'] | ||
- id: url | ||
type: string | ||
brief: 'Deprecated, use `url.full` instead.' | ||
stability: deprecated | ||
examples: ['https://www.foo.bar/search?q=OpenTelemetry#SemConv'] | ||
- id: target | ||
type: string | ||
brief: 'Deprecated, use `url.path` and `url.query` instead.' | ||
stability: deprecated | ||
examples: ['/search?q=OpenTelemetry#SemConv'] | ||
- id: request_content_length | ||
type: int | ||
brief: 'Deprecated, use `http.request.body.size` instead.' | ||
stability: deprecated | ||
examples: 3495 | ||
- id: response_content_length | ||
type: int | ||
brief: 'Deprecated, use `http.response.body.size` instead.' | ||
stability: deprecated | ||
examples: 3495 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,21 +8,21 @@ groups: | |
These conventions can be used for http and https schemes | ||
and various HTTP versions like 1.1, 2 and SPDY. | ||
attributes: | ||
- id: request_content_length | ||
- id: request.body.size | ||
type: int | ||
brief: > | ||
The size of the request 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. | ||
examples: 3495 | ||
- id: response_content_length | ||
- id: response.body.size | ||
type: int | ||
brief: > | ||
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. | ||
examples: 3495 | ||
- ref: http.method | ||
- ref: http.request.method | ||
sampling_relevant: true | ||
- ref: network.transport | ||
requirement_level: | ||
|
@@ -37,17 +37,6 @@ groups: | |
span_kind: client | ||
brief: 'Semantic Convention for HTTP Client' | ||
attributes: | ||
- id: url | ||
type: string | ||
requirement_level: required | ||
brief: > | ||
Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. | ||
Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless. | ||
note: > | ||
`http.url` MUST NOT contain credentials passed via URL in form of `https://username:[email protected]/`. | ||
In such case the attribute's value should be `https://www.example.com/`. | ||
sampling_relevant: true | ||
examples: ['https://www.foo.bar/search?q=OpenTelemetry#SemConv'] | ||
- id: resend_count | ||
type: int | ||
brief: > | ||
|
@@ -85,6 +74,10 @@ groups: | |
- ref: server.socket.domain | ||
- ref: server.socket.address | ||
- ref: server.socket.port | ||
- ref: url.full | ||
sampling_relevant: true | ||
requirement_level: required | ||
|
||
|
||
- id: trace.http.server | ||
prefix: http | ||
|
@@ -93,14 +86,6 @@ groups: | |
span_kind: server | ||
brief: 'Semantic Convention for HTTP Server' | ||
attributes: | ||
- id: target | ||
type: string | ||
brief: 'The full request target as passed in a HTTP request line or equivalent.' | ||
requirement_level: required | ||
sampling_relevant: true | ||
examples: ['/users/12314/?q=ddds'] | ||
- ref: http.scheme | ||
sampling_relevant: true | ||
- ref: server.address | ||
requirement_level: required | ||
sampling_relevant: true | ||
|
@@ -149,3 +134,12 @@ groups: | |
Otherwise, the immediate client peer port. | ||
- ref: client.socket.address | ||
- ref: client.socket.port | ||
- ref: url.path | ||
requirement_level: required | ||
sampling_relevant: true | ||
- ref: url.query | ||
sampling_relevant: true | ||
- ref: url.scheme | ||
sampling_relevant: true | ||
requirement_level: required | ||
examples: ["http", "https"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
groups: | ||
- id: url | ||
brief: Attributes describing URL. | ||
type: attribute_group | ||
prefix: url | ||
attributes: | ||
- id: scheme | ||
type: string | ||
brief: 'The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol.' | ||
examples: ["https", "ftp", "telnet"] | ||
- id: full | ||
type: string | ||
brief: Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986) | ||
note: > | ||
For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment | ||
is not transmitted over HTTP, but if it is known, it should be included nevertheless. | ||
`url.full` MUST NOT contain credentials passed via URL in form of `https://username:[email protected]/`. | ||
In such case username and password should be redacted and attribute's value should be `https://REDACTED:[email protected]/`. | ||
`url.full` SHOULD capture the absolute URL when it is available (or can be reconstructed) | ||
and SHOULD NOT be validated or modified except for sanitizing purposes. | ||
examples: ['https://www.foo.bar/search?q=OpenTelemetry#SemConv', '//localhost'] | ||
tag: sensitive-information | ||
- id: path | ||
type: string | ||
brief: 'The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component' | ||
examples: ['/search'] | ||
note: When missing, the value is assumed to be `/` | ||
- id: query | ||
type: string | ||
brief: 'The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component' | ||
examples: ["q=OpenTelemetry"] | ||
note: Sensitive content provided in query string SHOULD be scrubbed when instrumentations can identify it. | ||
tag: sensitive-information | ||
- id: fragment | ||
type: string | ||
brief: 'The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component' | ||
examples: ["SemConv"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Semantic conventions for URL | ||
|
||
**Status**: [Experimental](../document-status.md) | ||
|
||
This document defines semantic conventions that describe URL and its components. | ||
|
||
<details> | ||
<summary>Table of Contents</summary> | ||
|
||
<!-- toc --> | ||
|
||
- [Attributes](#attributes) | ||
- [Sensitive information](#sensitive-information) | ||
|
||
<!-- tocstop --> | ||
|
||
</details> | ||
|
||
## Attributes | ||
|
||
<!-- semconv url --> | ||
| Attribute | Type | Description | Examples | Requirement Level | | ||
|---|---|---|---|---| | ||
| `url.scheme` | string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. | `https`; `ftp`; `telnet` | Recommended | | ||
| `url.full` | string | Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986) [1] | `https://www.foo.bar/search?q=OpenTelemetry#SemConv`; `//localhost` | Recommended | | ||
| `url.path` | string | The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component [2] | `/search` | Recommended | | ||
| `url.query` | string | The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component [3] | `q=OpenTelemetry` | Recommended | | ||
| `url.fragment` | string | The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component | `SemConv` | Recommended | | ||
|
||
**[1]:** For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless. | ||
`url.full` MUST NOT contain credentials passed via URL in form of `https://username:[email protected]/`. In such case username and password should be redacted and attribute's value should be `https://REDACTED:[email protected]/`. | ||
`url.full` SHOULD capture the absolute URL when it is available (or can be reconstructed) and SHOULD NOT be validated or modified except for sanitizing purposes. | ||
|
||
**[2]:** When missing, the value is assumed to be `/` | ||
|
||
**[3]:** Sensitive content provided in query string SHOULD be scrubbed when instrumentations can identify it. | ||
<!-- endsemconv --> | ||
|
||
## Sensitive information | ||
|
||
Capturing URL and its components MAY impose security risk. User and password information, when they are provided in [User Information](https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1) subcomponent, MUST NOT be recorded. | ||
|
||
Instrumentations that are aware of specific sensitive query string parameters MUST scrub their values before capturing `url.query` attribute. For example, native instrumentation of a client library that passes credentials or user location in URL, must scrub corresponding properties. | ||
|
||
_Note: Applications and telemetry consumers should scrub sensitive information from URL attributes on collected telemetry. In systems unable to identify sensitive information, certain attribute values may be redacted entirely._ |
Oops, something went wrong.