w3c / trace-context

Trace Context
https://w3c.github.io/trace-context/
Other
469 stars 76 forks source link

Random part of trace ID should be uniformly distributed #544

Open oertl opened 1 year ago

oertl commented 1 year ago

Currently, it is not mentioned that the random part of the trace ID (when the random flag is set) should be uniformly distributed. Compare https://w3c.github.io/trace-context/#trace-id, https://w3c.github.io/trace-context/#random-trace-id-flag, and https://w3c.github.io/trace-context/#randomness-of-trace-id. To be useful for sampling, it should be explicitly stated that the random part should follow a uniform distribution, meaning that all possible 2^56 values are equally likely. Otherwise, if we cannot rely on the uniform distribution, we would again need to hash the trace ID, which is exactly what we want to avoid with the random part.

FYI @PeterF778 @jmacd

yurishkuro commented 1 year ago

+1. I think it is implied, but not stated explicitly.

dyladan commented 1 year ago

+1 from me as well. i'll make a PR

dyladan commented 8 months ago

Created #558 and #559 for this. Please review at your convenience