lib/opentelemetry/instrumentation/http_client/patches/client.rb in opentelemetry-instrumentation-http_client-0.19.3 vs lib/opentelemetry/instrumentation/http_client/patches/client.rb in opentelemetry-instrumentation-http_client-0.19.4
- old
+ new
@@ -14,17 +14,18 @@
def do_get_block(req, proxy, conn, &block) # rubocop:disable Metrics/AbcSize
uri = req.header.request_uri
url = "#{uri.scheme}://#{uri.host}"
request_method = req.header.request_method
+
attributes = {
'http.method' => request_method,
'http.scheme' => uri.scheme,
'http.target' => uri.path,
'http.url' => url,
'net.peer.name' => uri.host,
'net.peer.port' => uri.port
- }.merge(OpenTelemetry::Common::HTTP::ClientContext.attributes)
+ }.merge!(OpenTelemetry::Common::HTTP::ClientContext.attributes)
tracer.in_span("HTTP #{request_method}", attributes: attributes, kind: :client) do |span|
OpenTelemetry.propagation.inject(req.header)
super.tap do
response = conn.pop