Fix server.port type and trace tag source#1175
Conversation
server.port and network.peer.port are integers per OTel semconv but the trace activity tags emitted them via ToString(). server.address/server.port also read from ServerInfo.Host/Port, which is the server bind address (often 0.0.0.0), not the endpoint the client dialled. Source the trace host and port from the connect URI to match the metric tags, and cache the host, boxed port and client id once per ServerInfo change so the per-message path no longer re-boxes the port or re-allocates the client id string.
|
Claude finished @mtmk's task in 4m 0s —— View job PR Review
Overall: Correct and well-reasoned. The memory ordering is sound, the OTel spec fix is right, and the caching optimization is a genuine improvement. One pre-existing NRE risk is worth noting. Memory ordering — correctThe OTel spec conformance — correct
Address source fix — correctUsing Pre-existing NRE risk in
|
Emit server.port and network.peer.port as integers per the OTel messaging semantic conventions instead of strings, and source server.address/server.port from the connect URI rather than the server bind address (which is often 0.0.0.0). The host, boxed port and client id are cached per ServerInfo change so the per-message trace path avoids re-boxing and re-allocating.
Fixes #1167
Fixes #1156