Add logging and metrics for upstream responses
Is your feature request related to a problem? Please describe.
Yes, we recently had a production issue with sso_proxy in which it was 5xx'ing and it was not immediately apparent from looking at the sso_proxy logs that sso_proxy itself was generating the 5xx or if it was from an upstream service.
Describe the solution you'd like
It would be helpful to include in the logs another field, possibly upstream that contains at least the following data:
service(upstream service name)request_url(being made to the upstream)connection_timeresponse_timestatus_code
The above information might be useful to also include as metrics (except for request_url).
It could also be useful to provide a proxy_error field that identifies any connectivity or time out issues to disambiguate situations where, for example, the proxy generates a 502/504 vs the upstream responding with a 502/504.
Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.
Additional context It looks like the internal BF api-gateway service actually implements most of these already. Maybe some of that logic could be used/replicated here?