Skip to content

Commit 061c7c7

Browse files
exmaplantion wwhy mutations of tracestate are not required (#164)
1 parent 2591884 commit 061c7c7

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

trace_context/HTTP_HEADER_FORMAT_RATIONALE.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,42 @@ This prioritization of `tracestate` values improves performance of querying valu
4747
tracestate - typically you only need a first pair. It also allows to meaningfully truncate
4848
`tracestate` when required instead of dropping the entire list of values.
4949

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+
5086
### Size limits
5187

5288
#### Total size limit

0 commit comments

Comments
 (0)