Skip to content

Commit

Permalink
Send 128-bit trace IDs to the agent
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey Slotin committed Nov 24, 2020
1 parent 74bc815 commit a8d0143
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion json_span.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ func newW3CForeignParent(trCtx w3ctrace.Context) *ForeignParent {

// Span represents the OpenTracing span document to be sent to the agent
type Span struct {
TraceID int64 `json:"t"`
TraceID int64 `json:"-"`
TraceID128 string `json:"t"`
ParentID int64 `json:"p,omitempty"`
SpanID int64 `json:"s"`
Timestamp uint64 `json:"ts"`
Expand All @@ -145,6 +146,7 @@ func newSpan(span *spanS) Span {
data := RegisteredSpanType(span.Operation).ExtractData(span)
sp := Span{
TraceID: span.context.TraceID,
TraceID128: FormatLongID(span.context.TraceIDHi, span.context.TraceID),
ParentID: span.context.ParentID,
SpanID: span.context.SpanID,
Timestamp: uint64(span.Start.UnixNano()) / uint64(time.Millisecond),
Expand Down

0 comments on commit a8d0143

Please sign in to comment.