@@ -47,6 +47,42 @@ This prioritization of `tracestate` values improves performance of querying valu
47
47
tracestate - typically you only need a first pair. It also allows to meaningfully truncate
48
48
` tracestate ` when required instead of dropping the entire list of values.
49
49
50
+ ## Mutations of ` tracestate `
51
+
52
+ Two questions that comes up frequently is whether the ` tracestate ` header HAVE TO
53
+ be mutated on every mutation of ` span-id ` to identify the vendor which made this
54
+ change and whether two different vendors can modify the ` tracestate ` entries in
55
+ a single component.
56
+
57
+ This requirement may improve interoperability between vendors. For instance,
58
+ vendor may check the first ` tracestate ` key and provide some additional value
59
+ for the customer by adjusting data collection in the current component via the
60
+ knowledge of a caller behavior. For instance, apply specific sampling policies
61
+ or provide an experience for customers to get data from caller's vendor. There
62
+ are more scenarios that might be simplified by strict mutation requirements.
63
+
64
+ Even though improved interoperability will enable more scenarios specification
65
+ does not restrict number of mutations of ` tracestate ` and doesn't require the
66
+ mutation.
67
+
68
+ Main reason for not requiring the mutation is generic tracers. Generic tracers
69
+ are tracers which doesn't need to carry any information via ` tracestate ` and/or
70
+ doesn't have a single back-end this data will be stored in. The only thing
71
+ generic tracer can set in ` tracestate ` is either a key with some constant, an
72
+ empty value or a copy of ` traceparent ` . Neither of those details particularly
73
+ interesting for the callee. But requirement puts extra burden and complexity on
74
+ implementors. Another reason for not requiring a mutation is that allowing
75
+ multiple mutations may require vendors to check for more than one key anyway.
76
+
77
+ Some back-end neutral SDKs may be implemented so that destination back-end
78
+ decided via side-car or out-of-process agent configuration. In such cases
79
+ customer may decide to enable more than one headers mutations logic in
80
+ in-process SDK. Another requirement for multiple mutations is that in similar
81
+ environment where back-end destination is decided via out-of-process
82
+ configuration - certain header mutations may still be required. Example may be
83
+ smart sampling mechanisms that rely on additional data propagation in
84
+ ` tracestate ` .
85
+
50
86
### Size limits
51
87
52
88
#### Total size limit
0 commit comments