-
Notifications
You must be signed in to change notification settings - Fork 8k
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
API Gateway exceptionQps not recorded for upstream 5xx | 网关访问后端返回 5xx 时无法统计为异常 #1706
Comments
Web/API Gateway 统计异常时仅统计直接抛出的异常,而默认不对异常的 HTTP 状态码进行统计。当然这里可以搞个扩展点来完善下,欢迎讨论。 |
感谢. |
本机用sentinel-spring-cloud-gateway-example试了下,结果跟问题描述一致。有点奇怪,第一种找不到端口的场景,status也是500,这个不是状态码么,但异常进了统计 |
看代码应该是在InheritableBaseSubscriber里面进行的onError进行的判断,只针对连接进行了判断. |
网关后端服务异常的返回是不会走到网关的异常处理器的, 它默认这种是属于成功的(?) 而端口找不到就是网关内部的错误了, 都是500,区别还是存在的. 若要记录这种后端服务自身异常, 可以考虑添加一个过滤器使用ServerHttpResponseDecorator, 判断响应返回500时手动调用 Tracer.trace(ex), 或者返回 Mono.error(ex). |
[ISSUE alibaba#1706]feat(pull_consumer) refactor the consumer offset update logic
Issue Description
bug report
Describe what happened (or what feature you want)
使用spring-cloud-alibbaa集成的sentinel-spring-cloud-gateway-example测试代码
①通过网关访问后端服务,路由里配置一个错误的端口导致连接不上时,请求返回500,,exceptionQps统计数据有计数
②通过网关访问后端服务,接口能连接上,但是后端服务代码异常,请求同样返回500,,exceptionQps统计数据一直显示为0
Describe what you expected to happen
请求同样是500 希望都能统计
How to reproduce it (as minimally and precisely as possible)
Tell us your environment
spring-cloud-alibaba-gateway,2.2.1.RELEASE
Anything else we need to know?
The text was updated successfully, but these errors were encountered: