diff --git a/gqlopencensus/tracer.go b/gqlopencensus/tracer.go index 8a19d54367..7c37a06497 100644 --- a/gqlopencensus/tracer.go +++ b/gqlopencensus/tracer.go @@ -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)),