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

feat: instrument graphql #527

Merged
merged 17 commits into from
Dec 24, 2020

Conversation

robertlaurin
Copy link
Contributor

@robertlaurin robertlaurin commented Dec 22, 2020

Continuation of the work done here #410

Comment on lines +44 to +45
SomeOtherGraphQLAppSchema.remove_instance_variable(:@graphql_definition) if SomeOtherGraphQLAppSchema.instance_variable_defined?(:@graphql_definition)
SomeGraphQLAppSchema.remove_instance_variable(:@graphql_definition) if SomeGraphQLAppSchema.instance_variable_defined?(:@graphql_definition)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was some fairly tricky state leaking between tests, particularly for 1.9.x version of GraphQL. This is required to prevent duplicate tracers executing, as well as running the tests that would not otherwise have a tracer added. This came up when adding the config options for schemas.

Copy link
Contributor

@ericmustin ericmustin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, i had some minor feedback around config options/defaults and whether there was any interest in moving those "optionally on" fields to be events instead, but non blocking imo

Comment on lines 39 to 43
enable_platform_field: true,
# enable_platform_authorized maps to the authorized and authorized_lazy keys
enable_platform_authorized: true,
# enable_platform_resolve_type maps to the resolve_type and resolve_type_lazy keys
enable_platform_resolve_type: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very small nit but maybe we should leave these commented out so we avoid ppl copy/pasting this snippet in and enabling stuff that, for the most part, we want disabled

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see what you mean, I wanted to demonstrate how they could turn it on but I guess I can just as easily do that by provided a false value instead. I'll give it an update.

@fbogsany fbogsany merged commit 1e7d805 into open-telemetry:master Dec 24, 2020
@robertlaurin robertlaurin deleted the instrument-graphql branch December 24, 2020 20:21
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.

3 participants