12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/helios/opentelemetry/sdk/patches/faraday_patch.rb', line 12
def (span, env)
= env.
semantic_attributes = Helios::OpenTelemetry::SemanticAttributes
span.set_attribute(semantic_attributes::HTTP_REQUEST_HEADERS, .to_json)
span.set_attribute(semantic_attributes::HTTP_REQUEST_BODY, env.body) unless env.body.nil?
= env.
span.set_attribute(semantic_attributes::HTTP_RESPONSE_HEADERS, .to_json)
span.set_attribute(semantic_attributes::HTTP_RESPONSE_BODY, env.response_body) unless env.response_body.nil?
rescue StandardError => e
::OpenTelemetry.logger.debug("Error extracting faraday attributes: #{e}")
end
|