apache / skywalking

APM, Application Performance Monitoring System
https://skywalking.apache.org/
Apache License 2.0
23.87k stars 6.52k forks source link

skywalking springcloud gateway plugin not suppot springcloud greenwish sr4 #3985

Closed seifeHu closed 4 years ago

seifeHu commented 4 years ago

Bug

I can not got trace form springcloud gateway in skywalking. other springmvc app I can got trace In these versions

when I use spring springcloud version greenwish SR3(Spring Cloud Gateway 2.1.3.RELEASE ) 。I can got trace for Spring Cloud Gateway in Skywalking .

There are also some bugs in skywalking springcloud gateway plugin from springcloud sr3 I write customer filter for gateway. In filter do a spring feign method call in a mono ` public GatewayFilter apply(Config config) { return (exchange, chain) -> {

        Mono<Mono<Void>> objectMono = Mono.create(monoSink -> {
            executor.execute(new Runnable() {
                @Override
                public void run() {

                    CgiResult<JSONObject> cgiResult = null;
                    try {
                        cgiResult = iIotimTicketValidateService.validate(token, iotimTicket, din);
                    } catch (Exception e) {
                        logger.error("feign error:", e);
                    }

                    if (cgiResult != null && cgiResult.getErrCode() == 0) {

                        monoSink.success(chain.filter(exchange));
                    } else {
                        monoSink.success(unauthorizedResponse(exchange, cgiResult.getErrCode(), cgiResult == null ? "feign error" : cgiResult.getErrMsg()));
                    }
                }
            });
        });
        return objectMono;

}
This feign call not seen in one trace chain .

my call chain is
user ->gateway->feigncall_In_mono->feignRet->gatewayRouterToAppCall

wu-sheng commented 4 years ago

Gateway is a very complex scenario, @zhaoyuguang @ascrutae Please take a look.

@seifeHu Please try to debug first.