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

Allow graphql.field.parent and code.namespace to be nil #865

Closed
elenatanasoiu opened this issue Feb 13, 2024 · 1 comment · Fixed by #867
Closed

Allow graphql.field.parent and code.namespace to be nil #865

elenatanasoiu opened this issue Feb 13, 2024 · 1 comment · Fixed by #867
Labels
bug Something isn't working

Comments

@elenatanasoiu
Copy link
Contributor

elenatanasoiu commented Feb 13, 2024

Description of the bug

Source of the problem: https://github.com/open-telemetry/opentelemetry-ruby-contrib/blob/main/instrumentation/graphql/lib/opentelemetry/instrumentation/graphql/tracers/graphql_tracer.rb#L88

After turning on the enable_platform_field option to report execute_field and execute_field_lazy spans in our APM, we can now see some tests raise this error:

invalid span attribute value type NilClass for key 'graphql.field.parent' on span 'graphql.execute_field'

There are cases where we will add nil to graphql.field.parent, for example when the spans are parentless.

OpenTelemetry will validate the span attributes, will ignore invalid attributes and optionally call handle_error when doing so.

Our test helper currently raises an exception when handling such an error, which causes test failures.

We've had to specifically ignore the invalidgraphql.field.parent attribute message. We also do a similar thing for the code.namespace field:

next if message&.start_with?("invalid span attribute value type NilClass for key 'code.namespace'")
next if message&.start_with?("invalid span attribute value type NilClass for key 'graphql.field.parent'")

Share details about your runtime

N/A

@elenatanasoiu elenatanasoiu added the bug Something isn't working label Feb 13, 2024
@elenatanasoiu elenatanasoiu changed the title Allow graphql.field.parent and controller to be nil Allow graphql.field.parent and code.namespace to be nil Feb 13, 2024
@elenatanasoiu
Copy link
Contributor Author

Will be fixed by #867

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant