Skip to content

Commit

Permalink
change default operation name
Browse files Browse the repository at this point in the history
  • Loading branch information
katiehockman committed Aug 5, 2022
1 parent 8d90c9b commit 2ddbecd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions contrib/99designs/gqlgen/tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
)

const (
graphQLQuery = "graphql.query"
defaultGraphqlOperation = "graphql.request"

readOp = "graphql.read"
parsingOp = "graphql.parse"
Expand Down Expand Up @@ -71,7 +71,7 @@ func (t *gqlTracer) InterceptResponse(ctx context.Context, next graphql.Response
var (
octx *graphql.OperationContext
)
name := graphQLQuery
name := defaultGraphqlOperation
if graphql.HasOperationContext(ctx) {
// Variables in the operation will be left out of the tags
// until obfuscation is implemented in the agent.
Expand Down
4 changes: 2 additions & 2 deletions contrib/99designs/gqlgen/tracer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func TestOptions(t *testing.T) {
}{
"default": {
test: func(assert *assert.Assertions, root mocktracer.Span) {
assert.Equal(graphQLQuery, root.OperationName())
assert.Equal("graphql.query", root.OperationName())
assert.Equal(query, root.Tag(ext.ResourceName))
assert.Equal(defaultServiceName, root.Tag(ext.ServiceName))
assert.Equal(ext.SpanTypeGraphQL, root.Tag(ext.SpanType))
Expand Down Expand Up @@ -145,7 +145,7 @@ func TestChildSpans(t *testing.T) {
opNames = append(opNames, span.OperationName())
}
assert.ElementsMatch(resNames, []string{readOp, validationOp, parsingOp, query})
assert.ElementsMatch(opNames, []string{readOp, validationOp, parsingOp, graphQLQuery})
assert.ElementsMatch(opNames, []string{readOp, validationOp, parsingOp, "graphql.query"})
assert.NotNil(root)
assert.Nil(root.Tag(ext.Error))
}
Expand Down

0 comments on commit 2ddbecd

Please sign in to comment.