Skip to content

Commit

Permalink
Add cardinality warning about two opt-in attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
trask committed Oct 12, 2023
1 parent ea50a0d commit 20ebac5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ release.

### Fixes

- Add cardinality warning about two opt-in HTTP metric attributes
([#999](https://github.com/open-telemetry/semantic-conventions/pull/999))

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

- Remove experimental Kafka metrics ([#338](https://github.com/open-telemetry/semantic-conventions/pull/338))
Expand Down
6 changes: 6 additions & 0 deletions docs/http/http-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,13 +208,19 @@ Tracing instrumentations that do so, MUST also set `http.request.method_original

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 other metric dimensions.

**[3]:** 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 other metric dimensions.

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

| Value | Description |
Expand Down
6 changes: 6 additions & 0 deletions model/metrics/http.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ groups:
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 other metric dimensions.
- ref: server.port
requirement_level: opt_in
brief: >
Expand All @@ -64,6 +67,9 @@ groups:
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 other metric dimensions.
- id: metric.http.server.request.body.size
type: metric
metric_name: http.server.request.body.size
Expand Down

0 comments on commit 20ebac5

Please sign in to comment.