dd-trace-go
dd-trace-go copied to clipboard
contrib/99designs/gqlgen: additional options to reduce noise
What does this PR do?
Adds two new configuration options to contrib/99designs/gqlgen
, which have a similar end goal of reducing noise:
-
WithSkipFieldsForIntrospectionQuery
- if the
OperationName
isIntrospectionQuery
, spans are not created for each field
- if the
-
WithSkipFieldsWithTrivialResolver
- if the field resolver is trivial (doesn't require a function / can be accessed directly from the parent object), spans are not created
Motivation
We started using contrib/99designs/gqlgen
middleware recently and noticed it creates way more spans than we intended, most of which have little value for our needs.
Fixes #2684. Fixes #2610.
Reviewer's Checklist
- [ ] Changed code has unit tests for its functionality at or near 100% coverage.
- [ ] System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag.
- [ ] There is a benchmark for any new code, or changes to existing code.
- [ ] If this interacts with the agent in a new way, a system test has been added.
- [ ] Add an appropriate team label so this PR gets put in the right place for the release notes.
- [ ] Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild.
Unsure? Have a question? Request a review!