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

contrib/99designs/gqlgen: add WithCustomTag option #2598

Merged
merged 3 commits into from
Mar 13, 2024

Conversation

samsullivan
Copy link
Contributor

What does this PR do?

The gqlgen middleware was missing the ability to customize tags on the created spans. Implement a WithCustomTag option that follows the pattern of other similar packages.

I also renamed variable names for the config struct as cfg, instead of t, to match every other contrib package.

Motivation

Fixes #2597; supports the ability to use additional tagging with gqlgen traces.

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.

For Datadog employees:

  • If this PR touches code that handles credentials of any kind, such as Datadog API keys, I've requested a review from @DataDog/security-design-and-guidance.
  • This PR doesn't touch any of that.

Unsure? Have a question? Request a review!

The gqlgen middleware was missing the ability to customize tags on the created spans.
Implement a WithCustomTag option that follows the pattern of other similar packages.

Fixes DataDog#2597
@samsullivan samsullivan requested a review from a team as a code owner March 6, 2024 19:47
@felixge felixge requested a review from a team March 10, 2024 11:03
@dianashevchenko
Copy link
Contributor

@samsullivan Overall, looks good to me, but it would be nice to add a unit test 🙌

@samsullivan
Copy link
Contributor Author

@samsullivan Overall, looks good to me, but it would be nice to add a unit test 🙌

I'll take a look at adding one shortly 👍

@samsullivan
Copy link
Contributor Author

Pushed a new test case following the other option tests for this package, @dianashevchenko.

@dianashevchenko dianashevchenko enabled auto-merge (squash) March 13, 2024 10:43
@dianashevchenko dianashevchenko merged commit 8f46a7a into DataDog:main Mar 13, 2024
100 checks passed
@samsullivan samsullivan deleted the gqlgen/withcustomtag branch March 25, 2024 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for custom tags to gqlgen contrib
3 participants