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

(otelarrowreceiver): Start span after extracted context is returned #224

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -554,10 +554,6 @@ func (r *receiverStream) recvOne(streamCtx context.Context, serverStream anyStre
inflightCtx, flight := r.newInFlightData(streamCtx, method, req.GetBatchId(), pendingCh)
defer flight.recvDone(inflightCtx, &retErr)

// this span is a child of the inflight, covering the Arrow decode, Auth, etc.
inflightCtx, span := r.tracer.Start(inflightCtx, "otel_arrow_stream_recv")
defer span.End()

if err != nil {
if errors.Is(err, io.EOF) {
return status.Error(codes.Canceled, "client stream shutdown")
Expand All @@ -575,6 +571,11 @@ func (r *receiverStream) recvOne(streamCtx context.Context, serverStream anyStre
return status.Errorf(codes.Internal, "arrow metadata error: %v", err)
}

// start this span after hrcv.combineHeaders returns extracted context. This will allow this span
// to be a part of the data path trace instead of only being included as a child of the stream inflight trace.
inflightCtx, span := r.tracer.Start(inflightCtx, "otel_arrow_stream_recv")
defer span.End()

jmacd marked this conversation as resolved.
Show resolved Hide resolved
// Authorize the request, if configured, prior to acquiring resources.
if r.authServer != nil {
var authErr error
Expand Down
Loading