Skip to content

Commit 574349b

Browse files
committed
Consider X-Forwarded-Host / Forwarded when capturing server.address and server.port
1 parent cee22ec commit 574349b

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ release.
1111

1212
- BREAKING: Rename http.resend_count to http.request.resend_count.
1313
([#374](https://github.com/open-telemetry/semantic-conventions/pull/374))
14+
- BREAKING: Consider `X-Forwarded-Host` / `Forwarded` when capturing `server.address` and `server.port`.
15+
([#999](https://github.com/open-telemetry/semantic-conventions/pull/999))
1416

1517
### Features
1618

docs/http/http-metrics.md

+12
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ SHOULD include the [application root](/docs/http/http-spans.md#http-server-defin
131131
include host identifier.
132132
- Host identifier of the [request target](https://www.rfc-editor.org/rfc/rfc9110.html#target.resource)
133133
if it's sent in absolute-form.
134+
- Host identifier of [Forwarded#host](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Forwarded#host),
135+
[X-Forwarded-Host](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host), or a similar header.
134136
- Host identifier of the `Host` header
135137

136138
SHOULD NOT be set if only IP address is available and capturing name would require a reverse DNS lookup.
@@ -140,6 +142,8 @@ SHOULD NOT be set if only IP address is available and capturing name would requi
140142
- Port identifier of the [primary server host](/docs/http/http-spans.md#http-server-definitions) of the matched virtual host.
141143
- Port identifier of the [request target](https://www.rfc-editor.org/rfc/rfc9110.html#target.resource)
142144
if it's sent in absolute-form.
145+
- Host identifier of [Forwarded#host](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Forwarded#host),
146+
[X-Forwarded-Host](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host), or a similar header.
143147
- Port identifier of the `Host` header
144148

145149
`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.
@@ -310,6 +314,8 @@ SHOULD include the [application root](/docs/http/http-spans.md#http-server-defin
310314
include host identifier.
311315
- Host identifier of the [request target](https://www.rfc-editor.org/rfc/rfc9110.html#target.resource)
312316
if it's sent in absolute-form.
317+
- Host identifier of [Forwarded#host](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Forwarded#host),
318+
[X-Forwarded-Host](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host), or a similar header.
313319
- Host identifier of the `Host` header
314320

315321
SHOULD NOT be set if only IP address is available and capturing name would require a reverse DNS lookup.
@@ -319,6 +325,8 @@ SHOULD NOT be set if only IP address is available and capturing name would requi
319325
- Port identifier of the [primary server host](/docs/http/http-spans.md#http-server-definitions) of the matched virtual host.
320326
- Port identifier of the [request target](https://www.rfc-editor.org/rfc/rfc9110.html#target.resource)
321327
if it's sent in absolute-form.
328+
- Host identifier of [Forwarded#host](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Forwarded#host),
329+
[X-Forwarded-Host](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host), or a similar header.
322330
- Port identifier of the `Host` header
323331

324332
`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.
@@ -415,6 +423,8 @@ SHOULD include the [application root](/docs/http/http-spans.md#http-server-defin
415423
include host identifier.
416424
- Host identifier of the [request target](https://www.rfc-editor.org/rfc/rfc9110.html#target.resource)
417425
if it's sent in absolute-form.
426+
- Host identifier of [Forwarded#host](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Forwarded#host),
427+
[X-Forwarded-Host](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host), or a similar header.
418428
- Host identifier of the `Host` header
419429

420430
SHOULD NOT be set if only IP address is available and capturing name would require a reverse DNS lookup.
@@ -424,6 +434,8 @@ SHOULD NOT be set if only IP address is available and capturing name would requi
424434
- Port identifier of the [primary server host](/docs/http/http-spans.md#http-server-definitions) of the matched virtual host.
425435
- Port identifier of the [request target](https://www.rfc-editor.org/rfc/rfc9110.html#target.resource)
426436
if it's sent in absolute-form.
437+
- Host identifier of [Forwarded#host](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Forwarded#host),
438+
[X-Forwarded-Host](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host), or a similar header.
427439
- Port identifier of the `Host` header
428440

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

docs/http/http-spans.md

+4
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,8 @@ SHOULD include the [application root](/docs/http/http-spans.md#http-server-defin
393393
include host identifier.
394394
- Host identifier of the [request target](https://www.rfc-editor.org/rfc/rfc9110.html#target.resource)
395395
if it's sent in absolute-form.
396+
- Host identifier of [Forwarded#host](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Forwarded#host),
397+
[X-Forwarded-Host](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host), or a similar header.
396398
- Host identifier of the `Host` header
397399

398400
SHOULD NOT be set if only IP address is available and capturing name would require a reverse DNS lookup.
@@ -402,6 +404,8 @@ SHOULD NOT be set if only IP address is available and capturing name would requi
402404
- Port identifier of the [primary server host](/docs/http/http-spans.md#http-server-definitions) of the matched virtual host.
403405
- Port identifier of the [request target](https://www.rfc-editor.org/rfc/rfc9110.html#target.resource)
404406
if it's sent in absolute-form.
407+
- Host identifier of [Forwarded#host](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Forwarded#host),
408+
[X-Forwarded-Host](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host), or a similar header.
405409
- Port identifier of the `Host` header
406410

407411
**[6]:** If not default (`80` for `http` scheme, `443` for `https`).

model/http-common.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ groups:
8181
include host identifier.
8282
- Host identifier of the [request target](https://www.rfc-editor.org/rfc/rfc9110.html#target.resource)
8383
if it's sent in absolute-form.
84+
- Host identifier of [Forwarded#host](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Forwarded#host),
85+
[X-Forwarded-Host](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host), or a similar header.
8486
- Host identifier of the `Host` header
8587
8688
SHOULD NOT be set if only IP address is available and capturing name would require a reverse DNS lookup.
@@ -94,6 +96,8 @@ groups:
9496
- Port identifier of the [primary server host](/docs/http/http-spans.md#http-server-definitions) of the matched virtual host.
9597
- Port identifier of the [request target](https://www.rfc-editor.org/rfc/rfc9110.html#target.resource)
9698
if it's sent in absolute-form.
99+
- Host identifier of [Forwarded#host](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Forwarded#host),
100+
[X-Forwarded-Host](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host), or a similar header.
97101
- Port identifier of the `Host` header
98102
requirement_level:
99103
conditionally_required: If not default (`80` for `http` scheme, `443` for `https`).

0 commit comments

Comments
 (0)