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:
parent
00b1b07684
commit
bbd33115d1
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue