The best way I could think of doing this is by setting @usage on the StripeClient instance when request is called and appending it to the existing usage when setting last_request_metrics.
Note that in the tests, we need to send 2 requests, and the second request is the one that has usage telemetry for the first request (since the information is recorded in *last*_request_metrics).
The best way I could think of doing this is by setting
@usage
on theStripeClient
instance whenrequest
is called and appending it to the existing usage when settinglast_request_metrics
.Note that in the tests, we need to send 2 requests, and the second request is the one that has usage telemetry for the first request (since the information is recorded in
*last*_request_metrics
).