Skip to content

Commit

Permalink
opCtx.Operation could be nil
Browse files Browse the repository at this point in the history
  • Loading branch information
mkorolyov committed Mar 6, 2020
1 parent d60e177 commit cb0f66d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gqlopentracing/tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,13 @@ func (OpenTracingTracer) InterceptResponse(ctx context.Context, next graphql.Res
if opCtx.Operation != nil {
opName = opCtx.Operation.Name
}
if opName == "" {
if opName == "" && opCtx.Operation != nil {
//parent response case
opName = string(opCtx.Operation.Operation)
}
if opName == "" {
opName = opCtx.OperationName
}
span, ctx := opentracing.StartSpanFromContext(ctx, opName)
defer span.Finish()
ext.SpanKind.Set(span, "server")
Expand Down

0 comments on commit cb0f66d

Please sign in to comment.