mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-10-04 00:00:47 -04:00
* Add simple instrumentation callback We used to insert Faraday::Request::Instrumentation into our Faraday middleware stack to be able to instrument Stripe calls with StatsD. With Faraday being removed in version 5, this required some rework. This commit implements a simple callback system that can be used with any kind of instrumentation system. * Add a topic to Stripe::Instrumentation notifications ... and a :request topic to subscribe to * Use a RequestEvent value object instead of positional args in callback This way the RequestLogContext object doesn't get exposed externally. Since the same value object can be received by multiple subscribers it is frozen to prevent accidental mutations across threads. * Relocate tests for instrumentation and add more tests