You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/http/http-spans.md
+10-7
Original file line number
Diff line number
Diff line change
@@ -316,33 +316,35 @@ HTTP server frameworks and their instrumentations have a limited knowledge about
316
316
317
317
Certain web frameworks may provide additional information about server. For example CGI specification defines `SERVER_NAME` and `SERVER_PORT` ([RFC 3875][rfc-servername]) variables. HTTP servers usually know server names as they are provided by users in the configuration. See for example, the Apache [`ServerName`][ap-sn] or NGINX [`server_name`][nx-sn] directive.
318
318
319
-
Still, the original logical service name might not be available to the server HTTP instrumentation and instrumentations MAY provide an option to let users set `server.*` attributes.
319
+
Still, the original logical server name might not be available to the HTTP server instrumentation or be inaccurate.
320
320
321
321
#### Setting `server.address` and `server.port` attributes
322
322
323
+
In the context of HTTP server, `server.address` and `server.port` attributes capture logical host and port name and intended, whenever possible, to be the same on the client and server sides.
324
+
323
325
HTTP server instrumentations SHOULD do the best effort when populating `server.address` and `server.port` attributes and determine them by using the first of the following that applies:
324
326
325
-
* Explicit user configuration (if supported).
326
-
* Server name and port available through web framework or HTTP server configuration (if known to the instrumentation).
327
-
* The [request target](https://www.rfc-editor.org/rfc/rfc9110.html#target.resource) if it's passed in the absolute form.
328
327
* The original host which may be passed by the reverse proxy in the `host` identifier of the [`Forwarded`][Forwarded] header or in the [`X-Forwarded-Host`][X-Forwarded-Host] header.
328
+
* Server name and port available through web framework or HTTP server properties if they're based on the user configuration. Instrumentations SHOULD NOT use properties that rely on the `Host` header.
329
+
* The [request target][request target] if it's passed in the absolute form.
329
330
* The `Host` header.
330
331
331
-
As a result, `server.*` attributes capture logical host and port name and intended to be the same on the client and server sides. Application developers MAY capture private host information using applicable [resource attributes](/docs/resource/README.md).
332
-
333
332
> **Note**: The `Host` header specifies host and port number of the server. The same applies to the `host` identifier of `Forwarded` header, the `X-Forwarded-Host` header, or the authority component in the request target. Instrumentations SHOULD populate both `server.address` and `server.port` attributes by parsing the applicable property.
334
333
335
334
The `server.address` SHOULD NOT be set if only IP address is available and capturing name would require a reverse DNS lookup.
336
335
336
+
Application developers MAY overwrite potentially inaccurate values of `server.*` attributes using a [SpanProcessor][SpanProcessor] and MAY capture private host information using applicable [resource attributes](/docs/resource/README.md).
0 commit comments