Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Release Notes.
* Add an optional agent plugin to support mybatis.
* Add `spring-cloud-gateway-3.x` optional plugin.
* Add `okhttp-4.x` plugin.
* Fix NPE when thrift field is nested in plugin `thrift`

#### OAP-Backend
* BugFix: filter invalid Envoy access logs whose socket address is empty.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,25 +85,29 @@ public TField readFieldBegin() throws TException {
}
return readFieldBegin();
}
if (field.type == TType.STOP) {
Boolean haveCreatedSpan =
(Boolean) ContextManager.getRuntimeContext().get(HAVE_CREATED_SPAN);
if (haveCreatedSpan != null && !haveCreatedSpan) {
try {
AbstractSpan span = ContextManager.createEntrySpan(
context.getOperatorName(), createContextCarrier(null));
span.start(context.startTime);
span.tag(TAG_ARGS, context.getArguments());
span.setComponent(ComponentsDefine.THRIFT_SERVER);
SpanLayer.asRPCFramework(span);
} catch (Throwable throwable) {
LOGGER.error("Failed to create EntrySpan.", throwable);
} finally {
context = null;
}

return field;
}

@Override
public void readMessageEnd() throws TException {
super.readMessageEnd();
Boolean haveCreatedSpan =
(Boolean) ContextManager.getRuntimeContext().get(HAVE_CREATED_SPAN);
if (haveCreatedSpan != null && !haveCreatedSpan) {
try {
AbstractSpan span = ContextManager.createEntrySpan(
context.getOperatorName(), createContextCarrier(null));
span.start(context.startTime);
span.tag(TAG_ARGS, context.getArguments());
span.setComponent(ComponentsDefine.THRIFT_SERVER);
SpanLayer.asRPCFramework(span);
} catch (Throwable throwable) {
LOGGER.error("Failed to create EntrySpan.", throwable);
} finally {
context = null;
}
}
return field;
}

private ContextCarrier createContextCarrier(Map<String, String> header) {
Expand Down