lib/opentelemetry/instrumentation/net/http/patches/instrumentation.rb in opentelemetry-instrumentation-net_http-0.22.2 vs lib/opentelemetry/instrumentation/net/http/patches/instrumentation.rb in opentelemetry-instrumentation-net_http-0.22.3
- old
+ new
@@ -84,14 +84,22 @@
def tracer
Net::HTTP::Instrumentation.instance.tracer
end
def untraced?
+ untraced_context? || untraced_host?
+ end
+
+ def untraced_host?
return true if Net::HTTP::Instrumentation.instance.config[:untraced_hosts]&.any? do |host|
host.is_a?(Regexp) ? host.match?(@address) : host == @address
end
false
+ end
+
+ def untraced_context?
+ OpenTelemetry::Common::Utilities.untraced?
end
end
end
end
end