huangguangshan commented on PR #779:
URL: https://github.com/apache/skywalking-java/pull/779#issuecomment-3510507471

   
   
   
   > Please update changes and if some versions were not supported, please 
update the plugin test versions to verify it is supported with new changes.
   
   Environment
   
   Spring Cloud Gateway version: 2.0.0.RELEASE
   
   Dependency: spring-cloud-starter-gateway
   
   SkyWalking Java agent version: 9.5.0
   
   Plugin used: apm-spring-cloud-gateway-2.0.x-plugin-9.5.0.jar
   
   Problem Description
   
   When running a Spring Cloud Gateway 2.0.0 application with the SkyWalking 
Java agent (9.5.0) and enabling the apm-spring-cloud-gateway-2.0.x-plugin, the 
tracing context becomes inconsistent. The trace ID generated at the gateway 
does not match the trace ID observed in the downstream application after the 
request is forwarded.
   
   During application startup, the following error appears in 
skywalking-api.log:
   
   enhance class org.springframework.web.reactive.DispatcherHandler by plugin 
   
org.apache.skywalking.apm.plugin.spring.cloud.gateway.v20x.define.DispatcherHandlerInstrumentation
 
   is not activated. Witness class 
org.springframework.cloud.gateway.config.GatewayAutoConfiguration$1 does not 
exist.
   
   
   The same error repeats across several plugin enhancement attempts, 
indicating that multiple instrumentation definitions are being skipped.
   
   Root Cause
   
   The SkyWalking plugin for Spring Cloud Gateway 2.0.x uses the following 
witness class:
   
   org.springframework.cloud.gateway.config.GatewayAutoConfiguration$1
   
   
   However, in Spring Cloud Gateway 2.0.0, the anonymous inner class $1 does 
not exist in the bytecode.
   As a result, all instrumentations that rely on this witness class fail to 
activate, causing the gateway plugin to be skipped entirely.
   
   This explains why instrumentation for key classes—such as 
DispatcherHandler—is not applied, ultimately leading to trace ID inconsistency.


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to