open-telemetry / opentelemetry-ruby-contrib

Contrib Packages for the OpenTelemetry Ruby API and SDK implementation.
https://opentelemetry.io
Apache License 2.0
86 stars 174 forks source link

Add steps on how to turn off tracing in graphQL #1010

Open alexus37 opened 5 months ago

alexus37 commented 5 months ago

I'm excited to learn about the steps needed to disable otel tracing in GraphQL.

cc @arielvalentin

arielvalentin commented 5 months ago

To elaborate here a bit we are missing docs on disabling or customizing instrumentation using environment variables. Right now, we only have it via configs.

https://opentelemetry.io/docs/languages/ruby/libraries/#overriding-configuration-for-specific-instrumentation-libraries

arielvalentin commented 5 months ago

The RubyDocs has a snippet that we should include on opentelemetry.io: https://rubydoc.info/gems/opentelemetry-instrumentation-base/0.22.3/OpenTelemetry/Instrumentation/Base

The instrumention class establishes a convention for disabling an instrumentation by environment variable and local configuration. An instrumentation disabled by environment variable will take precedence over local config. The convention for environment variable name is the library name, upcased with '::' replaced by underscores, OPENTELEMETRY shortened to OTEL_LANG, and '_ENABLED' appended. For example: OTEL_RUBY_INSTRUMENTATION_SINATRA_ENABLED = false.

@robbkidd As you have motioned may times before... we need better tooling around documentation and options!

github-actions[bot] commented 4 months ago

👋 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.

xuan-cao-swi commented 3 months ago

Would the updated doc resolve this kind issue?