-
Notifications
You must be signed in to change notification settings - Fork 3
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
链路 tag 新增 Response Body 信息 #73
Comments
开启参数: |
观测云官方文档:https://docs.guance.com/integrations/ddtrace-ext-changelog/ 关闭issue |
开启 Response Body 信息获取后,会导致在某些情况下服务 OOM,比如当response返回的是文件信息(流)时,会发生oom,需要寻找替代方法 |
遇到的问题:
代码分析: // doFilter 之前可以处理请求
ResponseWrapper wrapper = new ResponseWrapper(httpServletResponse);
filterChain.doFilter(request, wrapper);
// doFilter 之后可以处理相应
由于wrapper拦截了服务响应和客户端之间的流传输,这里需要写回去,但是不知道服务端在写的时候用的是哪个方法。
按照 v1.30.6-guance tag里面的代码 如果遇到下载文件 浏览器收不到任何响应。 可能的解决办法:在wrapper中就判断该相应是json还是别的contentType,做出区分,同时 在服务端调用getOutputStream和 getwrite 标记。这样在filter中就可以知道是不是json数据,也知道哪个方法在调用。再将数据写回去。 |
response body 即请求响应体,java 一般都是通过流的方式进行获取的,有一定的风险性。body也比较复杂,目前需要支持
context-type:json
的body。并需要通过开关控制,key 为response_body
。The text was updated successfully, but these errors were encountered: