Skip to content

Commit

Permalink
add complexityLimit and operationComplexity to StartOperationExecution
Browse files Browse the repository at this point in the history
  • Loading branch information
vvakame committed Nov 2, 2018
1 parent 4e7e6a1 commit 256e741
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions gqlopencensus/tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ func (tracerImpl) StartOperationExecution(ctx context.Context) context.Context {
span.AddAttributes(
trace.StringAttribute("request.query", requestContext.RawQuery),
)
if requestContext.ComplexityLimit > 0 {
span.AddAttributes(
trace.Int64Attribute("request.complexityLimit", int64(requestContext.ComplexityLimit)),
trace.Int64Attribute("request.operationComplexity", int64(requestContext.OperationComplexity)),
)
}

for key, val := range requestContext.Variables {
span.AddAttributes(
trace.StringAttribute(fmt.Sprintf("request.variables.%s", key), fmt.Sprintf("%+v", val)),
Expand Down

0 comments on commit 256e741

Please sign in to comment.