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