未验证 提交 9529a75b 编写于 作者: 彭勇升 pengys 提交者: GitHub

Fixed/920 (#921)

* Fixed #920

* Sync sub module.
上级 3bde71ce
......@@ -57,13 +57,14 @@ public class ReferenceIdExchanger implements IdExchanger<ReferenceDecorator> {
}
@Override public boolean exchange(ReferenceDecorator standardBuilder, int applicationId) {
if (standardBuilder.getEntryServiceId() == 0 && StringUtils.isNotEmpty(standardBuilder.getEntryServiceName())) {
int entryServiceId = serviceNameService.getOrCreate(instanceCacheService.getApplicationId(standardBuilder.getEntryApplicationInstanceId()), SpanType.Entry_VALUE, standardBuilder.getEntryServiceName());
if (standardBuilder.getEntryServiceId() == 0) {
String entryServiceName = StringUtils.isNotEmpty(standardBuilder.getEntryServiceName()) ? standardBuilder.getEntryServiceName() : Const.DOMAIN_OPERATION_NAME;
int entryServiceId = serviceNameService.getOrCreate(instanceCacheService.getApplicationId(standardBuilder.getEntryApplicationInstanceId()), SpanType.Entry_VALUE, entryServiceName);
if (entryServiceId == 0) {
if (logger.isDebugEnabled()) {
int entryApplicationId = instanceCacheService.getApplicationId(standardBuilder.getEntryApplicationInstanceId());
logger.debug("entry service name: {} from application id: {} exchange failed", standardBuilder.getEntryServiceName(), entryApplicationId);
logger.debug("entry service name: {} from application id: {} exchange failed", entryServiceName, entryApplicationId);
}
return false;
} else {
......@@ -73,13 +74,14 @@ public class ReferenceIdExchanger implements IdExchanger<ReferenceDecorator> {
}
}
if (standardBuilder.getParentServiceId() == 0 && StringUtils.isNotEmpty(standardBuilder.getParentServiceName())) {
int parentServiceId = serviceNameService.getOrCreate(instanceCacheService.getApplicationId(standardBuilder.getParentApplicationInstanceId()), SpanType.Entry_VALUE, standardBuilder.getParentServiceName());
if (standardBuilder.getParentServiceId() == 0) {
String parentServiceName = StringUtils.isNotEmpty(standardBuilder.getParentServiceName()) ? standardBuilder.getParentServiceName() : Const.DOMAIN_OPERATION_NAME;
int parentServiceId = serviceNameService.getOrCreate(instanceCacheService.getApplicationId(standardBuilder.getParentApplicationInstanceId()), SpanType.Entry_VALUE, parentServiceName);
if (parentServiceId == 0) {
if (logger.isDebugEnabled()) {
int parentApplicationId = instanceCacheService.getApplicationId(standardBuilder.getParentApplicationInstanceId());
logger.debug("parent service name: {} from application id: {} exchange failed", standardBuilder.getParentServiceName(), parentApplicationId);
logger.debug("parent service name: {} from application id: {} exchange failed", parentServiceName, parentApplicationId);
}
return false;
} else {
......
......@@ -70,11 +70,12 @@ public class SpanIdExchanger implements IdExchanger<SpanDecorator> {
}
}
if (standardBuilder.getOperationNameId() == 0 && StringUtils.isNotEmpty(standardBuilder.getOperationName())) {
int operationNameId = serviceNameService.getOrCreate(applicationId, standardBuilder.getSpanTypeValue(), standardBuilder.getOperationName());
if (standardBuilder.getOperationNameId() == 0) {
String operationName = StringUtils.isNotEmpty(standardBuilder.getOperationName()) ? standardBuilder.getOperationName() : Const.DOMAIN_OPERATION_NAME;
int operationNameId = serviceNameService.getOrCreate(applicationId, standardBuilder.getSpanTypeValue(), operationName);
if (operationNameId == 0) {
logger.debug("service name: {} from application id: {} exchange failed", standardBuilder.getOperationName(), applicationId);
logger.debug("service name: {} from application id: {} exchange failed", operationName, applicationId);
return false;
} else {
standardBuilder.toBuilder();
......
......@@ -35,4 +35,5 @@ public class Const {
public static final String EMPTY_STRING = "";
public static final String FILE_SUFFIX = "sw";
public static final int SPAN_TYPE_VIRTUAL = 9;
public static final String DOMAIN_OPERATION_NAME = "{domain}";
}
Subproject commit 839e39861b12d0cd4ce11672ede459fe4dbb00c4
Subproject commit 9c503a299aa3cba211e851e507d5625cc7cc0dd5
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册