Fix dubbo trace/span cross-process propagation (#3442)

* fix(instrument): fix dubbo client trace inject adapter.

* fix(instrument): fix dubbo client trace inject adapter.
This commit is contained in:
zmapleshine 2021-06-30 23:47:46 +08:00 committed by GitHub
parent 00b1b07684
commit bbd33115d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -6,14 +6,14 @@
package io.opentelemetry.instrumentation.apachedubbo.v2_7;
import io.opentelemetry.context.propagation.TextMapSetter;
import org.apache.dubbo.rpc.RpcInvocation;
import org.apache.dubbo.rpc.RpcContext;
class DubboInjectAdapter implements TextMapSetter<RpcInvocation> {
class DubboInjectAdapter implements TextMapSetter<RpcContext> {
static final DubboInjectAdapter SETTER = new DubboInjectAdapter();
@Override
public void set(RpcInvocation rpcInvocation, String key, String value) {
rpcInvocation.setAttachment(key, value);
public void set(RpcContext rpcContext, String key, String value) {
rpcContext.setAttachment(key, value);
}
}

View File

@ -40,7 +40,7 @@ public class OpenTelemetryFilter implements Filter {
final Context context;
if (kind.equals(CLIENT)) {
context = tracer.startClientSpan(interfaceName, methodName);
tracer.inject(context, (RpcInvocation) invocation, DubboInjectAdapter.SETTER);
tracer.inject(context, rpcContext, DubboInjectAdapter.SETTER);
} else {
context = tracer.startServerSpan(interfaceName, methodName, (RpcInvocation) invocation);
}