elastic / apm-agent-ruby

https://www.elastic.co/solutions/apm
Apache License 2.0
168 stars 131 forks source link

Elastic APM v4.7.0 breaks versions of Faraday < 1.3.0 #1418

Closed ryanwi closed 11 months ago

ryanwi commented 1 year ago

In an application with Faraday v0.17.4, experienced new errors after upgrading the Elastic APM gem from v4.6.0 to v4.7.0. Elastic APM is looking for a response_status on Faraday errors that does not exist in older versions of Faraday.

errors were:

undefined method `response_status' for #<Faraday::TimeoutError:0x00007f401377b2d0>
undefined method `response_status' for #<Faraday::SSLError:0x00007fbcac2e7960>
undefined method `response_status' for #<Faraday::ConnectionFailed:0x00007fae7dcd8420> 

Here is the change in v4.7.0: https://github.com/elastic/apm-agent-ruby/compare/v4.6.0...v4.7.0#diff-4b5630a4907f497d4416de76c8dd5a162f4a525222dc3c11bdcef2182a9cdbcdR112

response_status was introduced to Faraday in this commit: https://github.com/lostisland/faraday/commit/023cc413351ce6c4a7cc01a3037dc2fcbe3d7dbc and is only available in faraday versions >= 1.3.0

estolfo commented 1 year ago

Thanks for reporting this and for the looking into the details @ryanwi

estolfo commented 1 year ago

Hi @ryanwi I've opened a PR to fix this. If you have a chance to try it out, that'd be great. Thanks!

ryanwi commented 11 months ago

Thank you @estolfo !I haven't had a chance to test it, but will check it out when the Dependabot update comes through.