Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to skip Introspection tracing #2610

Open
liamzhang40 opened this issue Mar 12, 2024 · 1 comment
Open

Add option to skip Introspection tracing #2610

liamzhang40 opened this issue Mar 12, 2024 · 1 comment
Labels
apm:ecosystem contrib/* related feature requests or bugs enhancement quick change/addition that does not need full team approval proposal/accepted Accepted proposals proposal more in depth change that requires full team approval

Comments

@liamzhang40
Copy link

liamzhang40 commented Mar 12, 2024

Thanks for creating this tracer for gqlgen contrib/99designs/gqlgen.

I find it unnecessary to trace the Introspection Query since it creates a huge amount of spans. Can there be an option to disable the tracing of it? Specifically the field spans

We currently wrap around gqlTracer and create a new tracer that looks at the OperationName from gql context and just skips if it is a Introspection query

func (t *wrapperGQLTracer) InterceptField(ctx context.Context, next graphql.Resolver) (any, error) {
	opCtx := graphql.GetOperationContext(ctx)
	if opCtx.OperationName == "IntrospectionQuery" {
		res, err := next(ctx)
		return res, err
	}

	if t, ok := t.baseTracer.(graphql.FieldInterceptor); ok {
		return t.InterceptField(ctx, next)
	}

	res, err := next(ctx)
	return res, err
}

Similar to this DataDog/dd-trace-js#1046

@liamzhang40 liamzhang40 added the enhancement quick change/addition that does not need full team approval label Mar 12, 2024
@github-actions github-actions bot added the needs-triage New issues that have not yet been triaged label Mar 12, 2024
@darccio darccio added proposal more in depth change that requires full team approval apm:ecosystem contrib/* related feature requests or bugs proposal/accepted Accepted proposals and removed needs-triage New issues that have not yet been triaged proposal more in depth change that requires full team approval labels Mar 19, 2024
@darccio
Copy link
Contributor

darccio commented Apr 30, 2024

@liamzhang40 We reviewed it, and we wanted to share it's accepted. If you want to contribute, we'll be glad to review and merge your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apm:ecosystem contrib/* related feature requests or bugs enhancement quick change/addition that does not need full team approval proposal/accepted Accepted proposals proposal more in depth change that requires full team approval
Projects
None yet
Development

No branches or pull requests

2 participants