|
|
@ -29,6 +29,8 @@ func (r *report) WriteSpan(raw *trace.Span) (err error) { |
|
|
|
traceID := model.TraceID{Low: ctx.TraceID} |
|
|
|
traceID := model.TraceID{Low: ctx.TraceID} |
|
|
|
spanID := model.ID(ctx.SpanID) |
|
|
|
spanID := model.ID(ctx.SpanID) |
|
|
|
parentID := model.ID(ctx.ParentID) |
|
|
|
parentID := model.ID(ctx.ParentID) |
|
|
|
|
|
|
|
tags := raw.Tags() |
|
|
|
|
|
|
|
logs := raw.Logs() |
|
|
|
span := model.SpanModel{ |
|
|
|
span := model.SpanModel{ |
|
|
|
SpanContext: model.SpanContext{ |
|
|
|
SpanContext: model.SpanContext{ |
|
|
|
TraceID: traceID, |
|
|
|
TraceID: traceID, |
|
|
@ -38,9 +40,9 @@ func (r *report) WriteSpan(raw *trace.Span) (err error) { |
|
|
|
Name: raw.Name(), |
|
|
|
Name: raw.Name(), |
|
|
|
Timestamp: raw.StartTime(), |
|
|
|
Timestamp: raw.StartTime(), |
|
|
|
Duration: raw.Duration(), |
|
|
|
Duration: raw.Duration(), |
|
|
|
Tags: make(map[string]string, len(raw.Tags())), |
|
|
|
Tags: make(map[string]string, len(tags)+len(logs)), |
|
|
|
} |
|
|
|
} |
|
|
|
for _, tag := range raw.Tags() { |
|
|
|
for _, tag := range tags { |
|
|
|
switch tag.Key { |
|
|
|
switch tag.Key { |
|
|
|
case trace.TagSpanKind: |
|
|
|
case trace.TagSpanKind: |
|
|
|
switch tag.Value.(string) { |
|
|
|
switch tag.Value.(string) { |
|
|
@ -64,7 +66,7 @@ func (r *report) WriteSpan(raw *trace.Span) (err error) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
for _, lg := range raw.Logs() { |
|
|
|
for _, lg := range logs { |
|
|
|
span.Tags[lg.Key] = string(lg.Value) |
|
|
|
span.Tags[lg.Key] = string(lg.Value) |
|
|
|
} |
|
|
|
} |
|
|
|
r.rpt.Send(span) |
|
|
|
r.rpt.Send(span) |
|
|
|