trace-context icon indicating copy to clipboard operation
trace-context copied to clipboard

Server-timing names

Open SergeyKanzhelev opened this issue 11 months ago • 6 comments

Following up on https://github.com/w3c/trace-context/pull/560

The possible alternative for naming would be:

instead of:

server-timing: trace;tid=0af7651916cd43dd8448eb211c80319c,cid=b7ad6b7169203331

use

server-timing: span;id=b7ad6b7169203331,tid=0af7651916cd43dd8448eb211c80319c

Benefits:

  1. It is already clear that the information about "server" - meaning we should not even introduce the term "child".
  2. Opens a door to add span name and duration to the same list and make it into a metric
  3. Does not require introducing naming distributed-trace or similar to clarify what trace means
  4. Makes it more natural to understand which one is "ID" without understanding what the difference between "c" and "t"
  5. Shortens 2 characters

SergeyKanzhelev avatar Feb 27 '24 20:02 SergeyKanzhelev

@dyladan

SergeyKanzhelev avatar Feb 27 '24 21:02 SergeyKanzhelev

@SergeyKanzhelev : I like your proposal because it reframes it from the point of view of the server operation: its id, which trace it is part of, (optional) its sampling info, and its name/duration (in the future). So overall, I feel this fits better with having this info in server-timing.

CC: @dyladan @basti1302 @jcopi what do you think?

kalyanaj avatar Feb 28 '24 20:02 kalyanaj

Also, in the context of this discussion, should we think about its implications for trace state response as well? For example, is that a separate metric or can that information be folded into the above, etc.?

kalyanaj avatar Feb 29 '24 18:02 kalyanaj

Also, in the context of this discussion, should we think about its implications for trace state response as well? For example, is that a separate metric or can that information be folded into the above, etc.?

good question. I would think trace may be a better name for tracestate if we will introduce it

SergeyKanzhelev avatar Feb 29 '24 22:02 SergeyKanzhelev

I feel there is a tradeoff between: (a) choosing metric names that makes the most sense for what the metric represents and (b) names that make it easy to mentally connect the response Server-Time metrics with the corresponding request headers (and thus might make the spec as a whole easier to understand intuitively).

I agree that the metric name span makes a lot of sense, if you just look at the new Server-Timing metric in isolation. On the other hand, calling that metric any one of traceparent, tracechild or traceresponse would make it very obvious that this is basically the same thing as the request header traceparent, just going into the other direction.

Same goes for the equivalent of the request header tracestate. Choosing a completely new name (like trace) might make sense in isolation, but I feel there is also value in reusing the name tracestate for a Server-Time metric, just for the sake of making it obvious that this is the same concept as the request header of the same name.

For some reason I cannot put my finger on, I feel a bit more strongly about this for tracestate than for traceparent.

How do you folks feel about introducing the new name span for the traceparent-equivalent metric while keeping tracestate as the name for tracestate-equivalent metric?

basti1302 avatar Mar 13 '24 06:03 basti1302

+1 to reuse the names

yurishkuro avatar Mar 13 '24 15:03 yurishkuro