Closed nandorholozsnyak closed 3 months ago
Hello, thanks for reaching out!
We can look into wiring up the response hooks to fire even if an HTTP error occurs, so you can capture and assess the response.
Hello, thanks for reaching out!
We can look into wiring up the response hooks to fire even if an HTTP error occurs, so you can capture and assess the response.
Hello there,
thank you for the quick answer, I could understand if it was made on purpose for not running those response hooks, but at the same time it could help us. If there are other integration/injection points to intercept these kind of data, I'm open for any of that.
We have released an update that should allow the response hooks to fire even if there is an API error, available in v7.4.1
We have released an update that should allow the response hooks to fire even if there is an API error, available in v7.4.1
That was fast. Thank you.
Feature Request Is New
Description of the feature
Hello there,
I'm looking forward for a way to create metrics about the API calls towards to the EasyPost API.
With the SDK it seemed like we would be able to use the Request and Response hooks, but based on the codebase, response hooks are not initiated if the response contains any kind of error (more specifically if this is true:
I tried to plug Micrometer a layer below into the
com.easypost.http.Requestor#createEasyPostConnection
method, but it is still not the best place, as we need a custom URLStreamHandler which still not the best solution. I like how it is almost fully dependency free, but at the same time it is a painpoint to use the low level HttpsURLConnection.So my question is, what is the best way to capture the start and the end of any API call to have the response code, URL and basically everything that I would need for a standard
http.client.requests
metrics which includes these tags/labels (http_method, http_status_code, outcome,error,uri etc.).