Closed lggomez closed 1 year ago
This issue has been automatically marked as stale because it has not had recent activity. Please comment here if it is still valid so that we can reprioritize. Thank you!
Closing this. Please reopen if you believe it should be addressed. Thank you for your contribution.
Is your feature request related to a problem? Please describe. This is somewhat related to #245 in regards of the usefulness of the current
metrics.Request
interfaceAs of now, during the client APIcall execution the http response body is decoded before calling the
EndRequest
method, thus sending a drained response to it:I get that this favors performance but also reduces the efficacy of these metrics interfaces in the first place since, for instance, any manual logging or introspection of the raw JSON payload is not possible
Describe the solution you'd like I'd like to be able to get the raw JSON response from the executed request
Describe alternatives you've considered I think a simple, non-obtrusive way would be to extend the
Request
interface with a hook method like the following, to be called before performing the JSON decoding:I get that this is a breaking change on the interface level but an empty implementation should have a negligible performance impact and for debugging or logging scenarios the following pattern can be applied to intercept request payloads: