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
PlatformTracing
per request trace configuration
#4001
PlatformTracing
per request trace configuration
#4001
Comments
👍 Yeah, makes sense to me to accept context one way or another. If it was me, I'd add a new parameter to |
We tried to implement your suggestion, but we found that the GraphQL type information ( To show our initial suggestion, I've created this demonstration as well. Not sure how best to avoid breaking the existing method signature for Let us know your thoughts how we can proceed on this. Thanks! |
Ahh... it receives execution context, not the trace data. Good news is, in recent GraphQL-Ruby versions (probably 1.11+?),
They're set during execution by this method: graphql-ruby/lib/graphql/execution/interpreter/runtime.rb Lines 850 to 863 in 170b402
I bet How about giving that a shot? |
We've added #4077 implementing the above suggestions. Can you pls take a look if it looks good? |
Is your feature request related to a problem? Please describe.
With
opentelemetry-instrumentation-graphql
, aGraphQLTracer
is provided based onGraphQL::Tracing::PlatformTracing
.It provides several schema level configuration options that can enable/disable specific parts of tracing.
I am looking for a way to manage these options per execution instead of being constant. For example, a HTTP header may request verbose traces be recorded, ideally enabling
enable_platform_field
for only this request's GraphQL execution.Describe the solution you'd like
When building the
platform_key
(here, here, here), I wonder if it makes sense to optionally providecontext
. This would enableplatform_field_key
/platform_resolve_type_key
/platform_authorized_key
to make request specific determinations based on the GraphQL execution context.For example, something like this would now be possible:
The platform key cache should not be impacted as it keeps it data under
context
, regenerated for each request.Additional context
I imagine this would be a nice to have for anything using
PlatformTracing
, not only Open Telemetry.The text was updated successfully, but these errors were encountered: