lib/opentelemetry/instrumentation/faraday/middlewares/tracer_middleware.rb in opentelemetry-instrumentation-faraday-0.23.2 vs lib/opentelemetry/instrumentation/faraday/middlewares/tracer_middleware.rb in opentelemetry-instrumentation-faraday-0.23.3
- old
+ new
@@ -42,12 +42,12 @@
attr_reader :app
def span_creation_attributes(http_method:, url:)
instrumentation_attrs = {
'http.method' => http_method,
- 'http.url' => OpenTelemetry::Common::Utilities.cleanse_url(url.to_s),
- 'net.peer.name' => url.host
+ 'http.url' => OpenTelemetry::Common::Utilities.cleanse_url(url.to_s)
}
+ instrumentation_attrs['net.peer.name'] = url.host if url.host
config = Faraday::Instrumentation.instance.config
instrumentation_attrs['peer.service'] = config[:peer_service] if config[:peer_service]
instrumentation_attrs.merge!(
OpenTelemetry::Common::HTTP::ClientContext.attributes
)