Skip to content

Commit 07826cb

Browse files
committed
proper warning and review
1 parent f8a0cc0 commit 07826cb

File tree

3 files changed

+40
-28
lines changed

3 files changed

+40
-28
lines changed

docs/http/http-metrics.md

+24-12
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,14 @@ SHOULD include the [application root](/docs/http/http-spans.md#http-server-defin
126126
**[5]:** `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 has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`.
127127

128128
**[6]:** See [Setting `server.address` and `server.port` attributes](/docs/http/http-spans.md#setting-serveraddress-and-serverport-attributes).
129-
> **Warning**: since this attribute may be based on HTTP headers, opting in to it may allow an attacker to trigger cardinality limits, degrading the usefulness of the metric.
129+
> **Warning**
130+
> Since this attribute may be based on HTTP headers, opting in to it may allow an attacker
131+
> to trigger cardinality limits, degrading the usefulness of the metric.
130132
131133
**[7]:** See [Setting `server.address` and `server.port` attributes](/docs/http/http-spans.md#setting-serveraddress-and-serverport-attributes).
132-
> **Warning**: since this attribute may be based on HTTP headers, opting in to it may allow an attacker to trigger cardinality limits, degrading the usefulness of the metric.
134+
> **Warning**
135+
> Since this attribute may be based on HTTP headers, opting in to it may allow an attacker
136+
> to trigger cardinality limits, degrading the usefulness of the metric.
133137
134138
**[8]:** The scheme of the original client request, if known (e.g. from [Forwarded](https://developer.mozilla.org/docs/Web/HTTP/Headers/Forwarded), [X-Forwarded-Proto](https://developer.mozilla.org/docs/Web/HTTP/Headers/X-Forwarded-Proto), or a similar header). Otherwise, the scheme of the immediate peer request.
135139

@@ -191,14 +195,14 @@ Instrumentations for specific web frameworks that consider HTTP methods to be ca
191195
Tracing instrumentations that do so, MUST also set `http.request.method_original` to the original value.
192196

193197
**[2]:** See [Setting `server.address` and `server.port` attributes](/docs/http/http-spans.md#setting-serveraddress-and-serverport-attributes).
194-
195-
> **Warning**: since this attribute may be based on HTTP headers, opting in to it may allow an attacker
196-
to trigger cardinality limits, degrading the usefulness of the metric.
198+
> **Warning**
199+
> Since this attribute may be based on HTTP headers, opting in to it may allow an attacker
200+
> to trigger cardinality limits, degrading the usefulness of the metric.
197201
198202
**[3]:** See [Setting `server.address` and `server.port` attributes](/docs/http/http-spans.md#setting-serveraddress-and-serverport-attributes).
199-
200-
> **Warning**: since this attribute may be based on HTTP headers, opting in to it may allow an attacker
201-
to trigger cardinality limits, degrading the usefulness of the metric.
203+
> **Warning**
204+
> Since this attribute may be based on HTTP headers, opting in to it may allow an attacker
205+
> to trigger cardinality limits, degrading the usefulness of the metric.
202206
203207
`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.
204208

@@ -283,10 +287,14 @@ SHOULD include the [application root](/docs/http/http-spans.md#http-server-defin
283287
**[5]:** `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 has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`.
284288

285289
**[6]:** See [Setting `server.address` and `server.port` attributes](/docs/http/http-spans.md#setting-serveraddress-and-serverport-attributes).
286-
> **Warning**: since this attribute may be based on HTTP headers, opting in to it may allow an attacker to trigger cardinality limits, degrading the usefulness of the metric.
290+
> **Warning**
291+
> Since this attribute may be based on HTTP headers, opting in to it may allow an attacker
292+
> to trigger cardinality limits, degrading the usefulness of the metric.
287293
288294
**[7]:** See [Setting `server.address` and `server.port` attributes](/docs/http/http-spans.md#setting-serveraddress-and-serverport-attributes).
289-
> **Warning**: since this attribute may be based on HTTP headers, opting in to it may allow an attacker to trigger cardinality limits, degrading the usefulness of the metric.
295+
> **Warning**
296+
> Since this attribute may be based on HTTP headers, opting in to it may allow an attacker
297+
> to trigger cardinality limits, degrading the usefulness of the metric.
290298
291299
**[8]:** The scheme of the original client request, if known (e.g. from [Forwarded](https://developer.mozilla.org/docs/Web/HTTP/Headers/Forwarded), [X-Forwarded-Proto](https://developer.mozilla.org/docs/Web/HTTP/Headers/X-Forwarded-Proto), or a similar header). Otherwise, the scheme of the immediate peer request.
292300

@@ -379,10 +387,14 @@ SHOULD include the [application root](/docs/http/http-spans.md#http-server-defin
379387
**[5]:** `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 has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`.
380388

381389
**[6]:** See [Setting `server.address` and `server.port` attributes](/docs/http/http-spans.md#setting-serveraddress-and-serverport-attributes).
382-
> **Warning**: since this attribute may be based on HTTP headers, opting in to it may allow an attacker to trigger cardinality limits, degrading the usefulness of the metric.
390+
> **Warning**
391+
> Since this attribute may be based on HTTP headers, opting in to it may allow an attacker
392+
> to trigger cardinality limits, degrading the usefulness of the metric.
383393
384394
**[7]:** See [Setting `server.address` and `server.port` attributes](/docs/http/http-spans.md#setting-serveraddress-and-serverport-attributes).
385-
> **Warning**: since this attribute may be based on HTTP headers, opting in to it may allow an attacker to trigger cardinality limits, degrading the usefulness of the metric.
395+
> **Warning**
396+
> Since this attribute may be based on HTTP headers, opting in to it may allow an attacker
397+
> to trigger cardinality limits, degrading the usefulness of the metric.
386398
387399
**[8]:** The scheme of the original client request, if known (e.g. from [Forwarded](https://developer.mozilla.org/docs/Web/HTTP/Headers/Forwarded), [X-Forwarded-Proto](https://developer.mozilla.org/docs/Web/HTTP/Headers/X-Forwarded-Proto), or a similar header). Otherwise, the scheme of the immediate peer request.
388400

docs/http/http-spans.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -301,13 +301,13 @@ HTTP requests sent to the same domain name may be handled by multiple applicatio
301301
For example, different versions of the same web-application can run side-by-side as independent applications behind the reverse proxy which routes request to one or another based on the request path.
302302

303303
Instances of different HTTP server applications may run on the same physical host and share the same IP address, but listen to different TCP/UDP ports.
304-
In order to route request to a specific application, reverse proxies usually modify the [HTTP Host header][Host and authority] replacing the original value provided by the client with an actual proxied server name. This behavior depends on the reverse proxy configuration. In some cases, `Host` header is not used when routing request to a specific application, making it prone to having bogus content.
304+
In order to route the request to a specific application, reverse proxies usually modify the [HTTP Host header][Host and authority] replacing the original value provided by the client with an actual proxied server name. This behavior depends on the reverse proxy configuration. In some cases, the `Host` header is not used when routing request to a specific application, making it prone to having bogus content.
305305

306306
HTTP server frameworks and their instrumentations have limited knowledge about the HTTP infrastructure and intermediaries that requests go through. In a general case, they can only use HTTP request properties such as request target or headers to populate `server.*` attributes.
307307

308308
#### Setting `server.address` and `server.port` attributes
309309

310-
In the context of HTTP server, `server.address` and `server.port` attributes capture the original host name and port. The are intended, whenever possible, to be the same on the client and server sides.
310+
In the context of HTTP server, `server.address` and `server.port` attributes capture the original host name and port. They are intended, whenever possible, to be the same on the client and server sides.
311311

312312
HTTP server instrumentations SHOULD do the best effort when populating `server.address` and `server.port` attributes and SHOULD determine them by using the first of the following that applies:
313313

model/metrics/http.yaml

+14-14
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ groups:
66
attributes:
77
- ref: server.address
88
requirement_level: opt_in
9-
note: >
9+
note: |
1010
See [Setting `server.address` and `server.port` attributes](/docs/http/http-spans.md#setting-serveraddress-and-serverport-attributes).
11-
12-
> **Warning**: since this attribute may be based on HTTP headers, opting in to it may allow an attacker
13-
to trigger cardinality limits, degrading the usefulness of the metric.
11+
> **Warning**
12+
> Since this attribute may be based on HTTP headers, opting in to it may allow an attacker
13+
> to trigger cardinality limits, degrading the usefulness of the metric.
1414
- ref: server.port
1515
requirement_level: opt_in
16-
note: >
16+
note: |
1717
See [Setting `server.address` and `server.port` attributes](/docs/http/http-spans.md#setting-serveraddress-and-serverport-attributes).
18-
19-
> **Warning**: since this attribute may be based on HTTP headers, opting in to it may allow an attacker
20-
to trigger cardinality limits, degrading the usefulness of the metric.
18+
> **Warning**
19+
> Since this attribute may be based on HTTP headers, opting in to it may allow an attacker
20+
> to trigger cardinality limits, degrading the usefulness of the metric.
2121
- id: metric_attributes.http.client
2222
type: attribute_group
2323
brief: 'HTTP client attributes'
@@ -52,18 +52,18 @@ groups:
5252
Name of the local HTTP server that received the request.
5353
note: |
5454
See [Setting `server.address` and `server.port` attributes](/docs/http/http-spans.md#setting-serveraddress-and-serverport-attributes).
55-
56-
> **Warning**: since this attribute may be based on HTTP headers, opting in to it may allow an attacker
57-
to trigger cardinality limits, degrading the usefulness of the metric.
55+
> **Warning**
56+
> Since this attribute may be based on HTTP headers, opting in to it may allow an attacker
57+
> to trigger cardinality limits, degrading the usefulness of the metric.
5858
- ref: server.port
5959
requirement_level: opt_in
6060
brief: >
6161
Port of the local HTTP server that received the request.
6262
note: |
6363
See [Setting `server.address` and `server.port` attributes](/docs/http/http-spans.md#setting-serveraddress-and-serverport-attributes).
64-
65-
> **Warning**: since this attribute may be based on HTTP headers, opting in to it may allow an attacker
66-
to trigger cardinality limits, degrading the usefulness of the metric.
64+
> **Warning**
65+
> Since this attribute may be based on HTTP headers, opting in to it may allow an attacker
66+
> to trigger cardinality limits, degrading the usefulness of the metric.
6767
6868
- id: metric.http.server.request.body.size
6969
type: metric

0 commit comments

Comments
 (0)