opentelemetry-ruby-contrib icon indicating copy to clipboard operation
opentelemetry-ruby-contrib copied to clipboard

[Feature Request] Add support to register the OTEL graphQL tracer to a mode.

Open alexus37 opened this issue 1 year ago • 8 comments

Currently, you can pass different schemas through the config to register the tracer. However, it's not currently feasible to register the tracer to a specific mode. This feature can be very handy if you aim to have a high-performance mode without any tracing and a separate trace mode for troubleshooting. In GraphQL code, this functionality is achieved by using trace_with, where you specify both the tracer module and the mode. For example:

::GraphQL::Schema.trace_with(Tracers::GraphQLTrace, mode: :otel_trace_mode)

alexus37 avatar Aug 19 '24 20:08 alexus37

Cc: @rmosolgo

arielvalentin avatar Aug 19 '24 20:08 arielvalentin

It certainly sounds good to me... the line above is taken straight from the instrumentation's source:

https://github.com/open-telemetry/opentelemetry-ruby-contrib/blob/a5648173c25576c4a2d5083958eb5ff0e7092d45/instrumentation/graphql/lib/opentelemetry/instrumentation/graphql/instrumentation.rb#L90

I think it's just a question of interface. Do you want to expose some kind of option that gets threaded through OpenTelementry and eventually passed there? Or, expose the trace module as a public API and invite users to attach it to their schema however they want?

rmosolgo avatar Aug 20 '24 21:08 rmosolgo

@alexus37 is on holiday so I can't speak for him but I think we don't need access to the entire trace module API at this point. Just having the option to configure a mode would be great.

elenatanasoiu avatar Aug 21 '24 15:08 elenatanasoiu

@alexus37 is on holiday so I can't speak for him but I think we don't need access to the entire trace module API at this point. Just having the option to configure a mode would be great.

I would agree with this too :)

x-eleos avatar Aug 21 '24 16:08 x-eleos

👋 This issue has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the keep label to hold stale off permanently, or do nothing. If you do nothing this issue will be closed eventually by the stale bot.

github-actions[bot] avatar Sep 21 '24 01:09 github-actions[bot]

@alexus37 - What do you think about @rmosolgo's question above?

https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues/1126#issuecomment-2299774561

kaylareopelle avatar Oct 01 '24 18:10 kaylareopelle

Do you want to expose some kind of option that gets threaded through OpenTelementry and eventually passed there?

I believe that if I could pass the mode parameter to take advantage of trace modes, it would definitely resolve my issue.

alexus37 avatar Oct 02 '24 07:10 alexus37

👋 This issue has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the keep label to hold stale off permanently, or do nothing. If you do nothing this issue will be closed eventually by the stale bot.

github-actions[bot] avatar Nov 02 '24 01:11 github-actions[bot]