Skip to content

Commit

Permalink
Cleanup code with tap
Browse files Browse the repository at this point in the history
  • Loading branch information
hannahramadan committed Sep 16, 2024
1 parent 6d0da5a commit 8f28f64
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ def perform(req, options)
span_name = create_request_span_name(request_method, uri.path)

attributes = {}
sem_conv.set_http_method(attributes, request_method)
sem_conv.set_http_scheme(attributes, uri.scheme)
sem_conv.set_http_target(attributes, uri.path, uri.query)
sem_conv.set_http_url(attributes, "#{uri.scheme}://#{uri.host}")
sem_conv.set_http_net_peer_name_client(attributes, uri.host)
sem_conv.set_http_peer_port_client(attributes, uri.port)
attributes.tap do |attrs|
sem_conv.set_http_method(attrs, request_method)
sem_conv.set_http_scheme(attrs, uri.scheme)
sem_conv.set_http_target(attrs, uri.path, uri.query)
sem_conv.set_http_url(attrs, "#{uri.scheme}://#{uri.host}")
sem_conv.set_http_net_peer_name_client(attrs, uri.host)
sem_conv.set_http_peer_port_client(attrs, uri.port)
end

attributes.merge!(OpenTelemetry::Common::HTTP::ClientContext.attributes)

Expand Down

0 comments on commit 8f28f64

Please sign in to comment.