lib/opentelemetry/instrumentation/net/http/patches/instrumentation.rb in opentelemetry-instrumentation-net_http-0.22.4 vs lib/opentelemetry/instrumentation/net/http/patches/instrumentation.rb in opentelemetry-instrumentation-net_http-0.22.6
- old
+ new
@@ -14,13 +14,13 @@
HTTP_METHODS_TO_SPAN_NAMES = Hash.new { |h, k| h[k] = "HTTP #{k}" }
USE_SSL_TO_SCHEME = { false => 'http', true => 'https' }.freeze
def request(req, body = nil, &block)
# Do not trace recursive call for starting the connection
- return super(req, body, &block) unless started?
+ return super unless started?
- return super(req, body, &block) if untraced?
+ return super if untraced?
attributes = {
OpenTelemetry::SemanticConventions::Trace::HTTP_METHOD => req.method,
OpenTelemetry::SemanticConventions::Trace::HTTP_SCHEME => USE_SSL_TO_SCHEME[use_ssl?],
OpenTelemetry::SemanticConventions::Trace::HTTP_TARGET => req.path,
@@ -33,10 +33,10 @@
attributes: attributes,
kind: :client
) do |span|
OpenTelemetry.propagation.inject(req)
- super(req, body, &block).tap do |response|
+ super.tap do |response|
annotate_span_with_response!(span, response)
end
end
end