-
Notifications
You must be signed in to change notification settings - Fork 4
Trace context support in propagation Inject/Extract #105
base: master
Are you sure you want to change the base?
Conversation
|
@tonyredondo is this ready to be reviewed? |
|
No, this is on hold based in the conversation today of random in 64 bits |
87e1ecb to
4b85f97
Compare
3d92df5 to
a4c0ece
Compare
| for k, v := range sc.Baggage { | ||
| carrier.Set(prefixBaggage+k, v) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot locate the tracestate header for the baggage in OTel format.
| return opentracing.ErrSpanContextCorrupted | ||
| } | ||
| traceParentArray := strings.Split(v, "-") | ||
| if len(traceParentArray) < 4 || traceParentArray[0] != "00" || len(traceParentArray[1]) != 32 || len(traceParentArray[2]) != 16 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if len(traceParentArray) < 4 || traceParentArray[0] != "00" || len(traceParentArray[1]) != 32 || len(traceParentArray[2]) != 16 { | |
| if len(traceParentArray) != 4 || traceParentArray[0] != "00" || len(traceParentArray[1]) != 32 || len(traceParentArray[2]) != 16 { |
| return opentracing.ErrSpanContextCorrupted | ||
| } | ||
|
|
||
| traceID, err = uuid.Parse(traceParentArray[1]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the Inject method, it is being removed the - characters, and here it is being parse without them. Canuuid.Parse function parse UUIDs without -?
| switch strings.ToLower(k) { | ||
| case fieldNameTraceID: | ||
| traceID, err = strconv.ParseUint(v, 16, 64) | ||
| traceID, err = uuid.Parse(v) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change implies all agents need to send UUID, isn't?
| return opentracing.ErrInvalidCarrier | ||
| } | ||
|
|
||
| state := wire.TracerState{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curiosity, are we using the binary protocol? Is there any standard for that?
8c172d4 to
d624e51
Compare
357af70 to
8ec9666
Compare
Trace context support in propagation Inject/Extract
Currently injects both
ot-andtraceparentheaders for compatibility withOTelreceptors.Try to extract both
ot-andtraceparentheadersTraceID changed from UInt64 to UUID
Implementation based on: https://www.w3.org/TR/trace-context-1/