Skip to content
Draft
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
10 changes: 9 additions & 1 deletion pkg/engine/internal/worker/thread.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ func (t *thread) runJob(ctx context.Context, job *threadJob) {
ctx, capture := xcap.NewCapture(ctx, nil)
defer capture.End()

ctx, span := xcap.StartSpan(ctx, tracer, "thread.runJob",
ctx, span := xcap.StartSpan(ctx, tracer, runJobSpanName(job.Task.Fragment),
trace.WithAttributes(attribute.Stringer("task_id", job.Task.ULID)),
)
defer span.End()
Expand Down Expand Up @@ -305,6 +305,14 @@ func (t *thread) runJob(ctx context.Context, job *threadJob) {
}
}

func runJobSpanName(plan *physical.Plan) string {
root, err := plan.Root()
if err != nil { // No root or multiple roots.
return "thread.runJob"
}
return "thread.runJob " + root.Type().String()
}

func (t *thread) drainPipeline(ctx context.Context, pipeline executor.Pipeline, sinks []recordSink, batchSizeRecords int64, logger log.Logger) (int, error) {
region := xcap.RegionFromContext(ctx)

Expand Down
Loading