-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
network semconv change: local/remote side no longer attributable #62
Comments
@Oberon00, thanks for creating the issue! I wonder if we really need to have a generic way on metrics, events, or logs to tell which side of communication are they on. The side is frequently implied (when filtering by service name), or irrelevant (when querying specific event or log). It might be that we need some wider semantics that would not apply to network-level roles only (producer, consumer, frontend, device, worker, leader/follower, replica, etc) and we'd regret having network-specific ones. |
@Oberon00 do you have a specific use-case / need for this? understanding your use-case / need may help us get on the same page, and would also help the HTTP semconv stability WG prioritize it properly. thx! |
For now, I don't know of a concrete use case. It's just a regression / information loss I noticed and from a theoretical perspective it seemed interesting enough to write up this issue. One theoretical use case could be some automated network mapping, where you display which host talks to which other host, based on all the telemetry sources you have. |
I think this need to move to the new semconv repo. |
Actually in the Zipkin exporter spec we need to come up with a remoteEndpoint which was net.peer.* and we describe something similar to the proposed mapping table in the text: open-telemetry/opentelemetry-specification#3794 (comment) It would be nice to have this in a general place. |
Background
This regression was introduced in open-telemetry/opentelemetry-specification#3402, see comment thread from here: open-telemetry/opentelemetry-specification#3402 (comment)
Description
Previous semantic conventions used the concepts "peer" to indicate the remote end and "host" to indicate the local end of a network connection. It is now no longer generally possible to know which is which, as the new concepts of server/client and source/destination are orthogonal to that.
There is one common case in which the assignment can still be made for server/client: Spans, as long as they don't have INTERNAL as SpanKind can use the rule "if server/consumer kind then server is the local side, otherwise client".
There is also the case of metrics where the metric definition makes it clear whether the local side is the client or server, according to @AlexanderWert open-telemetry/opentelemetry-specification#3402 (comment). IIUC, this requires a case-by-case knowledge to define a mapping metric ID -> "is client or server the local side".
Besides these two particular cases, it seems now impossible to tell which side is the local vs. remote. Most commonly, this may affect logs, metrics which are not known to the system wanting to know the local/remote end, and any use of source/destination where the remote/local-ness is completely unclear.
Proposal
Introduce a new semantic attribute
network.role
which may be one ofserver
,client
,sender
orreceiver
(closed set). Then the mapping is as follows:For peer to peer operations, esp. using source/destination, there may be cases where in a single operation that a metric/span/log line is recorded for, both the role of sender and receiver applies. In this case, the role should be arbitrarily chosen (by default, I suggest "sender") and source/destination attributes set consistently to allow correct local/remote attribution. It would also be possible to define an additional role "mixed" with same mapping as "sender" or define that role remains unset and "source" is by default the local end and "destination" the remote end.
Bikeshedding alternative: network.position instead of network.role would work as well, with values corresponding 1:1 to the prefixes that are then local, i.e. one of server/client/source/destination.
CC @lmolkova @trask
The text was updated successfully, but these errors were encountered: