You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2020/11/26 09:11:19 UTC

[GitHub] [skywalking] thanq opened a new issue #5905: skywalking 8.3 add springmvc plugin reactive api support , but that cant collect HTTP statusCode

thanq opened a new issue #5905:
URL: https://github.com/apache/skywalking/issues/5905


   Please answer these questions before submitting your issue.
   
   - Why do you submit this issue?
   - [ ] Feature improvement
   
   skywalking 8.3 add  springmvc plugin reactive api support , but that cant collect HTTP statusCode, hope somebody  can improve it
    


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] haoyann commented on issue #5905: skywalking 8.3 add springmvc plugin reactive api support , but that cant collect HTTP statusCode

Posted by GitBox <gi...@apache.org>.
haoyann commented on issue #5905:
URL: https://github.com/apache/skywalking/issues/5905#issuecomment-736971167


   org.apache.skywalking.apm.plugin.spring.mvc.commons.interceptor.AbstractMethodInterceptor add code 
   ```
       private static final String REACTIVE_RESPONSE_CLASS = "org.springframework.http.server.reactive.ServerHttpResponse";
       private static final String REACTIVE_GET_STATUS_METHOD = "getStatusCode";
   
       static {
           IS_SERVLET_GET_STATUS_METHOD_EXIST = MethodUtil.isMethodExist(
               AbstractMethodInterceptor.class.getClassLoader(), SERVLET_RESPONSE_CLASS, GET_STATUS_METHOD)
           ||  MethodUtil.isMethodExist(
                   AbstractMethodInterceptor.class.getClassLoader(), REACTIVE_RESPONSE_CLASS, REACTIVE_GET_STATUS_METHOD)
           ;
       }
   ```
   if want collect all statusCode change 
   ```
                   if (IS_SERVLET_GET_STATUS_METHOD_EXIST && response.statusCode() >= 400) {
                       span.errorOccurred();
                       Tags.STATUS_CODE.set(span, Integer.toString(response.statusCode()));
                   }
   ```
   
   ```
                   if (IS_SERVLET_GET_STATUS_METHOD_EXIST) {
                      if(response.statusCode() >= 400){
                          span.errorOccurred();
                      }
                   
                       Tags.STATUS_CODE.set(span, Integer.toString(response.statusCode()));
                   }
   ```
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] haoyann commented on issue #5905: skywalking 8.3 add springmvc plugin reactive api support , but that cant collect HTTP statusCode

Posted by GitBox <gi...@apache.org>.
haoyann commented on issue #5905:
URL: https://github.com/apache/skywalking/issues/5905#issuecomment-736985023


   > Could you submit a pull request directly? It would be better for the community, and keep the proof that you fix this.
   
   ok


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] wu-sheng closed issue #5905: skywalking 8.3 add springmvc plugin reactive api support , but that cant collect HTTP statusCode

Posted by GitBox <gi...@apache.org>.
wu-sheng closed issue #5905:
URL: https://github.com/apache/skywalking/issues/5905


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] wu-sheng commented on issue #5905: skywalking 8.3 add springmvc plugin reactive api support , but that cant collect HTTP statusCode

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #5905:
URL: https://github.com/apache/skywalking/issues/5905#issuecomment-736981847


   Could you submit a pull request directly? It would be better for the community, and keep the proof that you fix this.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org