feat(contrib/99designs/gqlgen): Add WithShouldStartSpanFunc option#3711
Conversation
|
@darccio @rarguelloF (@DataDog/apm-go @Datadog/apm-idm-go) It's been about three months since this was opened. Would it be possible to get a review? |
|
@tomoikey We'll take a look. Sorry for the inconvenience. |
rarguelloF
left a comment
There was a problem hiding this comment.
@tomoikey LGTM! thanks for your contribution and apologies for the delay 🙇
contrib/gqlgen): Add a configuration option to flexibly suppress GraphQL span generation|
/merge |
|
View all feedbacks in Devflow UI.
This merge request is not mergeable yet, because of pending checks/missing approvals. It will be added to the queue as soon as checks pass and/or get approvals.
devflow unqueued this merge request: It did not become mergeable within the expected time |
|
Thank you very much for your review! It appears the pull request is not mergeable due to a failing CI check on the PR title. As I am unfamiliar with the contribution guidelines for PR titles, would you be so kind as to advise on the necessary changes? |
|
/merge |
|
View all feedbacks in Devflow UI.
This merge request is not mergeable yet, because of pending checks/missing approvals. It will be added to the queue as soon as checks pass and/or get approvals.
The expected merge time in
|
What does this PR do?
This pull request introduces a new configuration option that allows users to flexibly filter the spans traced in a GraphQL environment using dd-trace-go and gqlgen.
Motivation
Due to its nature of fetching graphed data, GraphQL tends to generate a large number of spans. This issue is particularly prominent in environments that combine dd-trace-go with gqlgen.
While existing options like withoutTraceIntrospectionQuery and withoutTraceTrivialResolvedFields can suppress span generation under certain conditions, they lack flexibility. They are insufficient for handling cases where the span count inevitably increases due to schema design, such as with Relay's GraphQL Pagination. Currently, there is no mechanism to dynamically control span generation based on criteria like a field's path.
If left unaddressed, this issue can lead to serious consequences:
To resolve these problems, I have added a new configuration option that allows users to suppress span generation based on custom rules. This enables flexible control, such as disabling spans for resolvers with a specific field path, tailored to the project's requirements. Corresponding tests to validate this new configuration option have also been created.
Thank you.
Reviewer's Checklist
golangci-lint runlocally.Unsure? Have a question? Request a review!