-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[discuss]: How to distinguish whether the 5xx status code (eg 500) comes from upstream or apisix #2501
Comments
We may resort to the logging or tracing to determine this difference. The way you described is more like a debugging way, maybe it can be expanded to support more demands. |
Why not use |
I think if we can know the source of the abnormal request ( |
The meaning expressed in the description is to use |
The example you took is a relatively simple situation, problem like timeout is more sophisticated, you cannot know the cause oftimeout (connect, SSL handshake, read or write) without extra information in HTTP headers, in such a case, you still have to use other tools. Or we have to record enough messages in HTTP headers, which is heavy. At least we cannot enable this feature for all requests, maybe a switch is needed. |
I agree with this idea, it will speed up the speed of finding problems out, no need to check the log. When upstream returns 5xx, we get a response like this
When upstream times out, we can get a response like this
|
agree +1 ^_^ |
I agree with the idea of adding a new field in the response header. |
welcome PR to fix this issue ^_^ |
any update? |
I will submit a PR later to solve this problem. |
assigned to me. |
…rom upstream or apisix. close apache#2501
…rom upstream or apisix. close apache#2501
Issue description
When our http request gets an error status code
5XX
, for example: 500. How do we know if this status comes fromupstream
orapisix
.To know the source of the error status code, I think that in the response phase (
header_filter
), we can determine that the upstream response code is equal to5XX
. When it is equal to5XX
, we can set relevant headers in the response header to achieve our goal.The text was updated successfully, but these errors were encountered: