lib/instana/instrumentation/net-http.rb in instana-1.214.4 vs lib/instana/instrumentation/net-http.rb in instana-1.215.0

- old
+ new

@@ -5,11 +5,11 @@ module Instana module Instrumentation module NetHTTPInstrumentation def request(*args, &block) - if !Instana.tracer.tracing? || Instana.tracer.current_span.exit_span? || !started? + if skip_instrumentation? do_skip = true return super(*args, &block) end ::Instana.tracer.log_entry(:'net-http') @@ -61,9 +61,15 @@ rescue => e ::Instana.tracer.log_error(e) raise ensure ::Instana.tracer.log_exit(:'net-http', kv_payload) unless do_skip + end + + def skip_instrumentation? + dnt_spans = [:dynamodb, :sqs, :sns, :s3] + !Instana.tracer.tracing? || !started? || !Instana.config[:nethttp][:enabled] || + (!::Instana.tracer.current_span.nil? && dnt_spans.include?(::Instana.tracer.current_span.name)) end end end end