Skip to content
3 changes: 2 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ Release Notes.
* Support for tracing spring-cloud-gateway 4.x in gateway-4.x-plugin.
* Fix re-transform bug when plugin enhanced class proxy parent method.
* Fix error HTTP status codes not recording as SLA failures in Vert.x plugins.
* Support for HttpExchange request tracing
* Support for HttpExchange request tracing.
* Support tracing for async producing, batch sync consuming, and batch async consuming in rocketMQ-client-java-5.x-plugin.
* Convert the Redisson span into an async span.

#### Documentation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
import org.apache.skywalking.apm.network.trace.component.ComponentsDefine;
import org.redisson.api.RFuture;
import org.redisson.api.RLock;

import java.lang.reflect.Method;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;

public class RedissonHighLevelLockInterceptor implements InstanceMethodsAroundInterceptor {
Expand All @@ -48,7 +50,19 @@ public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allAr

@Override
public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes, Object ret) throws Throwable {
AbstractSpan span = ContextManager.activeSpan();
span.prepareForAsync();
ContextManager.stopSpan();

RFuture<Object> future = (RFuture) ret;
CompletableFuture<Object> completableFuture = future.toCompletableFuture();
completableFuture.whenComplete((res, ex) -> {
if (ex != null) {
span.errorOccurred();
span.log(ex);
}
span.asyncFinish();
});
return ret;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
import org.apache.skywalking.apm.network.trace.component.ComponentsDefine;
import org.redisson.api.RFuture;
import org.redisson.api.RLock;

import java.lang.reflect.Method;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;

public class RedissonLockInterceptor implements InstanceMethodsAroundInterceptor {
Expand All @@ -48,7 +50,19 @@ public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allAr

@Override
public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes, Object ret) throws Throwable {
AbstractSpan span = ContextManager.activeSpan();
span.prepareForAsync();
ContextManager.stopSpan();

RFuture<Object> future = (RFuture) ret;
CompletableFuture<Object> completableFuture = future.toCompletableFuture();
completableFuture.whenComplete((res, ex) -> {
if (ex != null) {
span.errorOccurred();
span.log(ex);
}
span.asyncFinish();
});
return ret;
}

Expand Down