Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tracing: start net/trace span in ChildSpan #16882

Merged
merged 1 commit into from
Jul 6, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions pkg/util/tracing/tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,13 +335,6 @@ func StartChildSpan(
linkShadowSpan(s, pSpan.shadowTr, pSpan.shadowSpan.Context(), opentracing.ChildOfRef)
}

if pSpan.netTr != nil || pSpan.shadowTr != nil {
// Copy baggage items to tags so they show up in the shadow tracer UI or x/net/trace.
for k, v := range s.mu.Baggage {
s.SetTag(k, v)
}
}

// Start recording if necessary.
if pSpan.isRecording() {
recordingGroup := pSpan.mu.recordingGroup
Expand All @@ -351,6 +344,18 @@ func StartChildSpan(
s.enableRecording(recordingGroup, pSpan.mu.recordingType)
}

if pSpan.netTr != nil {
s.netTr = trace.New("tracing", operationName)
s.netTr.SetMaxEvents(maxLogsPerSpan)
}

if pSpan.netTr != nil || pSpan.shadowTr != nil {
// Copy baggage items to tags so they show up in the shadow tracer UI or x/net/trace.
for k, v := range s.mu.Baggage {
s.SetTag(k, v)
}
}

pSpan.mu.Unlock()
return s
}
Expand Down