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 · 4 comments · May be fixed by #2695
Open

Add option to skip Introspection tracing #2610

liamzhang40 opened this issue Mar 12, 2024 · 4 comments · May be fixed by #2695
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.

@samsullivan
Copy link
Contributor

@liamzhang40, I assume #2695 covers what you were looking for?

@liamzhang40
Copy link
Author

@liamzhang40, I assume #2695 covers what you were looking for?

Yup! and skipping the trivial is icing on the cake

@samsullivan
Copy link
Contributor

Glad skipping trivial doesn't just apply to our use case! 🎉

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

Successfully merging a pull request may close this issue.

3 participants