Fix servicecomb plugin trace break in cse case (#460)

This commit is contained in:
Chenfx-git 2023-02-23 15:35:59 +08:00 committed by GitHub
parent 92af19c20f
commit 20c8b98cd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -16,6 +16,7 @@ Release Notes.
* Refactor kotlin coroutine plugin with CoroutineContext.
* Fix OracleURLParser ignoring actual port when :SID is absent.
* Change gRPC instrumentation point to fix plugin not working for server side.
* Fix servicecomb plugin trace break.
#### Documentation
* Update docs of Tracing APIs, reorganize the API docs into six parts.

View File

@ -42,7 +42,14 @@ public class ProducerOperationHandlerInterceptor implements InstanceMethodsAroun
CarrierItem next = contextCarrier.items();
while (next.hasNext()) {
next = next.next();
next.setHeadValue(invocation.getContext().get(next.getHeadKey()));
String headKey = next.getHeadKey();
if (invocation.getContext().containsKey(headKey)) {
// cse invoke scenario
next.setHeadValue(invocation.getContext().get(headKey));
} else {
// not cse invoke scenario
next.setHeadValue(invocation.getRequestEx().getHeader(headKey));
}
}
String operationName = invocation.getMicroserviceQualifiedName();
AbstractSpan span = ContextManager.createEntrySpan(operationName, contextCarrier);