When self-handling traceparent, the use case we came across is the need to compare the transaction settings in Agent.Tracer.CurrentTransaction with the value of the traceparent HTTP header. The traceparent can be deserialized (and checked) using TryDeserializeFromString, but the members are internal only.
The use case is to use a generic class (filter) to more complex logic whether to create a new transaction when running distributed or hook on to the current transaction. Remember when service names are different, a new transaction can be attached to the parent span, whereas with equal service names this is not possible.
It would make it easier to compare TraceId, ParentId and TraceState between the current transaction and traceparent using the deserialized version acquired as an instance of DistributedTracingData when these fields would be readonly public.
Workaround is compare the string of traceparent and assume validity when TryDeserializeFromString returns a non null value.
When self-handling traceparent, the use case we came across is the need to compare the transaction settings in
Agent.Tracer.CurrentTransaction
with the value of thetraceparent
HTTP header. Thetraceparent
can be deserialized (and checked) usingTryDeserializeFromString
, but the members are internal only.The use case is to use a generic class (filter) to more complex logic whether to create a new transaction when running distributed or hook on to the current transaction. Remember when service names are different, a new transaction can be attached to the parent span, whereas with equal service names this is not possible.
It would make it easier to compare
TraceId
,ParentId
andTraceState
between the current transaction andtraceparent
using the deserialized version acquired as an instance ofDistributedTracingData
when these fields would be readonly public.Workaround is compare the string of
traceparent
and assume validity whenTryDeserializeFromString
returns a non null value.