Skip to content

Commit

Permalink
Merge branch 'main' into add_previous_session_id
Browse files Browse the repository at this point in the history
  • Loading branch information
breedx-splk authored Oct 17, 2023
2 parents db98a81 + 242268e commit 1676bde
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 16 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ release.

- BREAKING: Rename http.resend_count to http.request.resend_count.
([#374](https://github.com/open-telemetry/semantic-conventions/pull/374))
- BREAKING: Define url.scheme in terms of logical operation in HTTP server semconv.
([#376](https://github.com/open-telemetry/semantic-conventions/pull/376))
- BREAKING: Change `network.transport` from recommended to opt-in in HTTP semconv.
([#402](https://github.com/open-telemetry/semantic-conventions/pull/402))

### Features

Expand All @@ -26,6 +30,8 @@ release.
([#401](https://github.com/open-telemetry/semantic-conventions/pull/401))
- Change `server.port` from recommended to conditionally required on HTTP server semconv.
([#399](https://github.com/open-telemetry/semantic-conventions/pull/399))
- Add cardinality warning about two opt-in HTTP metric attributes to all HTTP metrics.
([#412](https://github.com/open-telemetry/semantic-conventions/pull/412))

## v1.22.0 (2023-10-12)

Expand Down
30 changes: 27 additions & 3 deletions docs/http/http-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ of `[ 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10
| [`network.protocol.version`](../general/attributes.md) | string | Version of the protocol specified in `network.protocol.name`. [5] | `1.0`; `1.1`; `2`; `3` | Recommended |
| [`server.address`](../general/attributes.md) | string | Name of the local HTTP server that received the request. [6] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | Opt-In |
| [`server.port`](../general/attributes.md) | int | Port of the local HTTP server that received the request. [7] | `80`; `8080`; `443` | Opt-In |
| [`url.scheme`](../url/url.md) | string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. | `http`; `https` | Required |
| [`url.scheme`](../url/url.md) | string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. [8] | `http`; `https` | Required |

**[1]:** If the request fails with an error before response status code was sent or received,
`error.type` SHOULD be set to exception type (its fully-qualified class name, if applicable)
Expand Down Expand Up @@ -135,13 +135,21 @@ SHOULD include the [application root](/docs/http/http-spans.md#http-server-defin

SHOULD NOT be set if only IP address is available and capturing name would require a reverse DNS lookup.

Warning: since this attribute may be based on the `Host` header, opting in to it may allow an attacker
to trigger cardinality limits, degrading the usefulness of the metric.

**[7]:** Determined by using the first of the following that applies

- Port identifier of the [primary server host](/docs/http/http-spans.md#http-server-definitions) of the matched virtual host.
- Port identifier of the [request target](https://www.rfc-editor.org/rfc/rfc9110.html#target.resource)
if it's sent in absolute-form.
- Port identifier of the `Host` header

Warning: since this attribute may be based on the `Host` header, opting in to it may allow an attacker
to trigger cardinality limits, degrading the usefulness of the metric.

**[8]:** The scheme of the original client request, if known (e.g. from [Forwarded](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Forwarded), [X-Forwarded-Proto](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Proto), or a similar header). Otherwise, the scheme of the immediate peer request.

`error.type` 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.

| Value | Description |
Expand Down Expand Up @@ -263,7 +271,7 @@ This metric is optional.
| [`network.protocol.version`](../general/attributes.md) | string | Version of the protocol specified in `network.protocol.name`. [5] | `1.0`; `1.1`; `2`; `3` | Recommended |
| [`server.address`](../general/attributes.md) | string | Name of the local HTTP server that received the request. [6] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | Opt-In |
| [`server.port`](../general/attributes.md) | int | Port of the local HTTP server that received the request. [7] | `80`; `8080`; `443` | Opt-In |
| [`url.scheme`](../url/url.md) | string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. | `http`; `https` | Required |
| [`url.scheme`](../url/url.md) | string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. [8] | `http`; `https` | Required |

**[1]:** If the request fails with an error before response status code was sent or received,
`error.type` SHOULD be set to exception type (its fully-qualified class name, if applicable)
Expand Down Expand Up @@ -314,13 +322,21 @@ SHOULD include the [application root](/docs/http/http-spans.md#http-server-defin

SHOULD NOT be set if only IP address is available and capturing name would require a reverse DNS lookup.

Warning: since this attribute may be based on the `Host` header, opting in to it may allow an attacker
to trigger cardinality limits, degrading the usefulness of the metric.

**[7]:** Determined by using the first of the following that applies

- Port identifier of the [primary server host](/docs/http/http-spans.md#http-server-definitions) of the matched virtual host.
- Port identifier of the [request target](https://www.rfc-editor.org/rfc/rfc9110.html#target.resource)
if it's sent in absolute-form.
- Port identifier of the `Host` header

Warning: since this attribute may be based on the `Host` header, opting in to it may allow an attacker
to trigger cardinality limits, degrading the usefulness of the metric.

**[8]:** The scheme of the original client request, if known (e.g. from [Forwarded](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Forwarded), [X-Forwarded-Proto](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Proto), or a similar header). Otherwise, the scheme of the immediate peer request.

`error.type` 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.

| Value | Description |
Expand Down Expand Up @@ -368,7 +384,7 @@ This metric is optional.
| [`network.protocol.version`](../general/attributes.md) | string | Version of the protocol specified in `network.protocol.name`. [5] | `1.0`; `1.1`; `2`; `3` | Recommended |
| [`server.address`](../general/attributes.md) | string | Name of the local HTTP server that received the request. [6] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | Opt-In |
| [`server.port`](../general/attributes.md) | int | Port of the local HTTP server that received the request. [7] | `80`; `8080`; `443` | Opt-In |
| [`url.scheme`](../url/url.md) | string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. | `http`; `https` | Required |
| [`url.scheme`](../url/url.md) | string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. [8] | `http`; `https` | Required |

**[1]:** If the request fails with an error before response status code was sent or received,
`error.type` SHOULD be set to exception type (its fully-qualified class name, if applicable)
Expand Down Expand Up @@ -419,13 +435,21 @@ SHOULD include the [application root](/docs/http/http-spans.md#http-server-defin

SHOULD NOT be set if only IP address is available and capturing name would require a reverse DNS lookup.

Warning: since this attribute may be based on the `Host` header, opting in to it may allow an attacker
to trigger cardinality limits, degrading the usefulness of the metric.

**[7]:** Determined by using the first of the following that applies

- Port identifier of the [primary server host](/docs/http/http-spans.md#http-server-definitions) of the matched virtual host.
- Port identifier of the [request target](https://www.rfc-editor.org/rfc/rfc9110.html#target.resource)
if it's sent in absolute-form.
- Port identifier of the `Host` header

Warning: since this attribute may be based on the `Host` header, opting in to it may allow an attacker
to trigger cardinality limits, degrading the usefulness of the metric.

**[8]:** The scheme of the original client request, if known (e.g. from [Forwarded](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Forwarded), [X-Forwarded-Proto](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Proto), or a similar header). Otherwise, the scheme of the immediate peer request.

`error.type` 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.

| Value | Description |
Expand Down
18 changes: 7 additions & 11 deletions docs/http/http-spans.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ sections below.
| [`http.response.status_code`](../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.name`](../general/attributes.md) | string | [OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. [6] | `http`; `spdy` | Recommended: if not default (`http`). |
| [`network.protocol.version`](../general/attributes.md) | string | Version of the protocol specified in `network.protocol.name`. [7] | `1.0`; `1.1`; `2`; `3` | Recommended |
| [`network.transport`](../general/attributes.md) | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). [8] | `tcp`; `udp` | Conditionally Required: [9] |
| [`network.type`](../general/attributes.md) | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. [10] | `ipv4`; `ipv6` | Recommended |
| [`network.transport`](../general/attributes.md) | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). [8] | `tcp`; `udp` | Opt-In |
| [`network.type`](../general/attributes.md) | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. [9] | `ipv4`; `ipv6` | Recommended |
| `user_agent.original` | string | Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client. | `CERN-LineMode/2.15 libwww/2.17b3` | Recommended |

**[1]:** If the request fails with an error before response status code was sent or received,
Expand Down Expand Up @@ -175,15 +175,9 @@ The attribute value MUST consist of either multiple header values as an array of

**[7]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`.

**[8]:** The value SHOULD be normalized to lowercase.
**[8]:** Generally `tcp` for `HTTP/1.0`, `HTTP/1.1`, and `HTTP/2`. Generally `udp` for `HTTP/3`. Other obscure implementations are possible.

Consider always setting the transport when setting a port number, since
a port number is ambiguous without knowing the transport, for example
different processes could be listening on TCP port 12345 and UDP port 12345.

**[9]:** If not default (`tcp` for `HTTP/1.1` and `HTTP/2`, `udp` for `HTTP/3`).

**[10]:** The value SHOULD be normalized to lowercase.
**[9]:** The value SHOULD be normalized to lowercase.

Following attributes MUST be provided **at span creation time** (when provided at all), so they can be considered for sampling decisions:

Expand Down Expand Up @@ -378,7 +372,7 @@ For an HTTP server span, `SpanKind` MUST be `Server`.
| [`server.port`](../general/attributes.md) | int | Port of the local HTTP server that received the request. [5] | `80`; `8080`; `443` | Conditionally Required: [6] |
| [`url.path`](../url/url.md) | string | The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component [7] | `/search` | Required |
| [`url.query`](../url/url.md) | string | The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component [8] | `q=OpenTelemetry` | Conditionally Required: If and only if one was received/sent. |
| [`url.scheme`](../url/url.md) | string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. | `http`; `https` | Required |
| [`url.scheme`](../url/url.md) | string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. [9] | `http`; `https` | Required |

**[1]:** The IP address of the original client behind all proxies, if known (e.g. from [Forwarded](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Forwarded), [X-Forwarded-For](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For), or a similar header). Otherwise, the immediate client peer address.

Expand Down Expand Up @@ -410,6 +404,8 @@ SHOULD NOT be set if only IP address is available and capturing name would requi

**[8]:** Sensitive content provided in query string SHOULD be scrubbed when instrumentations can identify it.

**[9]:** The scheme of the original client request, if known (e.g. from [Forwarded](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Forwarded), [X-Forwarded-Proto](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Proto), or a similar header). Otherwise, the scheme of the immediate peer request.

Following attributes MUST be provided **at span creation time** (when provided at all), so they can be considered for sampling decisions:

* [`server.address`](../general/attributes.md)
Expand Down
6 changes: 6 additions & 0 deletions model/http-common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,9 @@ groups:
- ref: url.scheme
requirement_level: required
examples: ["http", "https"]
note: >
The scheme of the original client request, if known
(e.g. from [Forwarded](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Forwarded),
[X-Forwarded-Proto](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Proto),
or a similar header).
Otherwise, the scheme of the immediate peer request.
24 changes: 24 additions & 0 deletions model/metrics/http.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,32 @@ groups:
attributes:
- ref: server.address
requirement_level: opt_in
note: |
Determined by using the first of the following that applies
- The [primary server name](/docs/http/http-spans.md#http-server-definitions) of the matched virtual host. MUST only
include host identifier.
- Host identifier of the [request target](https://www.rfc-editor.org/rfc/rfc9110.html#target.resource)
if it's sent in absolute-form.
- Host identifier of the `Host` header
SHOULD NOT be set if only IP address is available and capturing name would require a reverse DNS lookup.
Warning: since this attribute may be based on the `Host` header, opting in to it may allow an attacker
to trigger cardinality limits, degrading the usefulness of the metric.
- ref: server.port
requirement_level: opt_in
note: |
Determined by using the first of the following that applies
- Port identifier of the [primary server host](/docs/http/http-spans.md#http-server-definitions) of the matched virtual host.
- Port identifier of the [request target](https://www.rfc-editor.org/rfc/rfc9110.html#target.resource)
if it's sent in absolute-form.
- Port identifier of the `Host` header
Warning: since this attribute may be based on the `Host` header, opting in to it may allow an attacker
to trigger cardinality limits, degrading the usefulness of the metric.
- id: metric_attributes.http.client
type: attribute_group
Expand Down
6 changes: 4 additions & 2 deletions model/trace/http.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ groups:
sampling_relevant: true
requirement_level: required
- ref: network.transport
requirement_level:
conditionally_required: If not default (`tcp` for `HTTP/1.1` and `HTTP/2`, `udp` for `HTTP/3`).
requirement_level: opt_in
note: >
Generally `tcp` for `HTTP/1.0`, `HTTP/1.1`, and `HTTP/2`. Generally `udp` for `HTTP/3`.
Other obscure implementations are possible.
- ref: network.type
- ref: user_agent.original

Expand Down

0 comments on commit 1676bde

Please sign in to comment.