Skip to content

Commit

Permalink
feat: disable SDK with env OTEL_SDK_DISABLED is defined as true
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrofurtado authored Dec 4, 2024
1 parent 583fe04 commit ffac037
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sdk/lib/opentelemetry/sdk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ module SDK
# c.use_all
# end
def configure
if ENV['OTEL_SDK_DISABLED'] == 'true'
OpenTelemetry.logger.warn "Environment variable OTEL_SDK_DISABLED is defined as true. SDK is disabled"
return
end

configurator = Configurator.new
yield configurator if block_given?
configurator.configure
Expand Down

0 comments on commit ffac037

Please sign in to comment.