10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/new_relic/agent/opentelemetry/segments/http_external.rb', line 10
def create_uri(attributes)
scheme = attributes['url.scheme'] || attributes['http.scheme']
host = attributes['server.address'] || attributes['net.peer.name']
port = attributes['server.port'] || attributes['net.peer.port']
path = attributes['url.path'] || attributes['http.target'] || NewRelic::SLASH
if [scheme, host, port, path].any?(&:nil?)
attributes['url.full'] || attributes['http.url']
else
"#{scheme}://#{host}:#{port}#{path}"
end
end
|