Skip to content

Commit

Permalink
trace: Log graphql.variables rather than tag
Browse files Browse the repository at this point in the history
According to the OT documentation tag values can be numeric types, strings, or
bools. The behavior of other tag value types is undefined at the OpenTracing
level. For example `github.com/lightstep/lightstep-tracer-go` generates error
events.
  • Loading branch information
keegancsmith authored and neelance committed Jan 30, 2018
1 parent 5d3b13f commit b466370
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion trace/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/neelance/graphql-go/introspection"
opentracing "github.com/opentracing/opentracing-go"
"github.com/opentracing/opentracing-go/ext"
"github.com/opentracing/opentracing-go/log"
)

type TraceQueryFinishFunc func([]*errors.QueryError)
Expand All @@ -29,7 +30,7 @@ func (OpenTracingTracer) TraceQuery(ctx context.Context, queryString string, ope
}

if len(variables) != 0 {
span.SetTag("graphql.variables", variables)
span.LogFields(log.Object("graphql.variables", variables))
}

return spanCtx, func(errs []*errors.QueryError) {
Expand Down

0 comments on commit b466370

Please sign in to comment.