Skip to content
This repository has been archived by the owner on Apr 8, 2020. It is now read-only.

add complexity values to tracing data #234

Merged
merged 1 commit into from
Oct 29, 2018
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion server/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module github.com/mercari/mtc2018-web/server

require (
cloud.google.com/go v0.30.0
github.com/99designs/gqlgen v0.4.5-0.20181028055237-0d5c65b6dc1c
github.com/99designs/gqlgen v0.4.5-0.20181029101704-784dc01fdb4f
github.com/DataDog/datadog-go v0.0.0-20180822151419-281ae9f2d895 // indirect
github.com/DataDog/opencensus-go-exporter-datadog v0.0.0-20180917103902-e6c7f767dc57
github.com/agnivade/levenshtein v1.0.1 // indirect
Expand Down
2 changes: 2 additions & 0 deletions server/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ cloud.google.com/go v0.30.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT
git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg=
github.com/99designs/gqlgen v0.4.5-0.20181028055237-0d5c65b6dc1c h1:enfJ7MaOw8DuF2USF9LeFjp4XaV3fqUnhaNuALWYsTM=
github.com/99designs/gqlgen v0.4.5-0.20181028055237-0d5c65b6dc1c/go.mod h1:KSQDfLlTTGmzlRgLGm6HeKKKo598l5E2svEM6Nz2Jnw=
github.com/99designs/gqlgen v0.4.5-0.20181029101704-784dc01fdb4f h1:H0iZ0U3L4GHjod/wAdRpf5sm4XcKN9DyM/X4W/Z+rl8=
github.com/99designs/gqlgen v0.4.5-0.20181029101704-784dc01fdb4f/go.mod h1:KSQDfLlTTGmzlRgLGm6HeKKKo598l5E2svEM6Nz2Jnw=
github.com/DataDog/datadog-go v0.0.0-20180822151419-281ae9f2d895 h1:dmc/C8bpE5VkQn65PNbbyACDC8xw8Hpp/NEurdPmQDQ=
github.com/DataDog/datadog-go v0.0.0-20180822151419-281ae9f2d895/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
github.com/DataDog/opencensus-go-exporter-datadog v0.0.0-20180917103902-e6c7f767dc57 h1:V1H8VVVxLALfaPLvAFCPoa0AN5nVPAqEu2UvH+QP3Vc=
Expand Down
2 changes: 2 additions & 0 deletions server/gqlapi/gqlopencensus/tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ func (t *tracerImpl) StartOperationExecution(ctx context.Context) context.Contex
requestContext := graphql.GetRequestContext(ctx)
span.AddAttributes(
trace.StringAttribute("request.query", requestContext.RawQuery),
trace.Int64Attribute("request.complexityLimit", int64(requestContext.ComplexityLimit)),
trace.Int64Attribute("request.operationComplexity", int64(requestContext.OperationComplexity)),
)
for key, val := range requestContext.Variables {
span.AddAttributes(
Expand Down