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

fix: add the error to the span created for a transformation #4618

Merged
merged 2 commits into from
Mar 31, 2022
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions execute/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ func (t *consecutiveTransport) contextWithSpan(ctx context.Context) context.Cont
return opentracing.ContextWithSpan(ctx, t.span)
}

func (t *consecutiveTransport) finishSpan() {
t.span.LogFields(log.Int("messages_processed", int(atomic.LoadInt32(&t.totalMsgs))))
func (t *consecutiveTransport) finishSpan(err error) {
t.span.LogFields(log.Int("messages_processed", int(atomic.LoadInt32(&t.totalMsgs))), log.Error(err))
t.span.Finish()
}

Expand All @@ -251,7 +251,7 @@ PROCESS:
}
// We are finished
close(t.finished)
t.finishSpan()
t.finishSpan(err)
return
}
}
Expand Down
1 change: 1 addition & 0 deletions lang/compiler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,7 @@ func TestQueryTracing(t *testing.T) {
if err := q.Err(); err != nil {
t.Fatal(err)
}
q.Done()

// If tracing was enabled, then we should see spans for each
// source and transformation. If tracing is not enabled, we should
Expand Down