提交 89427dc5 编写于 作者: J Jason Song 提交者: GitHub

Merge pull request #709 from powerYao/req_master

Update CatEventType to TracerEventType
......@@ -5,7 +5,6 @@ import com.ctrip.framework.apollo.biz.repository.AppRepository;
import com.ctrip.framework.apollo.common.entity.App;
import com.ctrip.framework.apollo.common.exception.BadRequestException;
import com.ctrip.framework.apollo.common.exception.ServiceException;
import com.ctrip.framework.apollo.common.utils.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
......
......@@ -4,7 +4,7 @@ import com.ctrip.framework.apollo.common.exception.ServiceException;
import com.ctrip.framework.apollo.core.MetaDomainConsts;
import com.ctrip.framework.apollo.core.dto.ServiceDTO;
import com.ctrip.framework.apollo.core.enums.Env;
import com.ctrip.framework.apollo.portal.constant.CatEventType;
import com.ctrip.framework.apollo.portal.constant.TracerEventType;
import com.ctrip.framework.apollo.tracer.Tracer;
import com.ctrip.framework.apollo.tracer.spi.Transaction;
......@@ -101,7 +101,7 @@ public class RetryableRestTemplate {
logger.error("Http request failed, uri: {}, method: {}", uri, method, t);
Tracer.logError(t);
if (canRetry(t, method)) {
Tracer.logEvent(CatEventType.API_RETRY, uri);
Tracer.logEvent(TracerEventType.API_RETRY, uri);
} else {//biz exception rethrow
ct.setStatus(t);
ct.complete();
......@@ -144,7 +144,7 @@ public class RetryableRestTemplate {
logger.error("Http request failed, uri: {}, method: {}", uri, HttpMethod.GET, t);
Tracer.logError(t);
if (canRetry(t, HttpMethod.GET)) {
Tracer.logEvent(CatEventType.API_RETRY, uri);
Tracer.logEvent(TracerEventType.API_RETRY, uri);
} else {// biz exception rethrow
ct.setStatus(t);
ct.complete();
......
package com.ctrip.framework.apollo.portal.constant;
public interface CatEventType {
public interface TracerEventType {
String RELEASE_NAMESPACE = "Namespace.Release";
......
......@@ -8,7 +8,7 @@ import com.ctrip.framework.apollo.common.exception.BadRequestException;
import com.ctrip.framework.apollo.common.utils.BeanUtils;
import com.ctrip.framework.apollo.core.enums.Env;
import com.ctrip.framework.apollo.portal.api.AdminServiceAPI;
import com.ctrip.framework.apollo.portal.constant.CatEventType;
import com.ctrip.framework.apollo.portal.constant.TracerEventType;
import com.ctrip.framework.apollo.portal.entity.bo.UserInfo;
import com.ctrip.framework.apollo.portal.entity.vo.EnvClusterInfo;
import com.ctrip.framework.apollo.portal.repository.AppRepository;
......@@ -101,7 +101,7 @@ public class AppService {
appNamespaceService.createDefaultAppNamespace(appId);
roleInitializationService.initAppRoles(createdApp);
Tracer.logEvent(CatEventType.CREATE_APP, appId);
Tracer.logEvent(TracerEventType.CREATE_APP, appId);
return createdApp;
}
......
......@@ -4,7 +4,7 @@ import com.ctrip.framework.apollo.common.dto.ClusterDTO;
import com.ctrip.framework.apollo.common.exception.BadRequestException;
import com.ctrip.framework.apollo.core.enums.Env;
import com.ctrip.framework.apollo.portal.api.AdminServiceAPI;
import com.ctrip.framework.apollo.portal.constant.CatEventType;
import com.ctrip.framework.apollo.portal.constant.TracerEventType;
import com.ctrip.framework.apollo.portal.spi.UserInfoHolder;
import com.ctrip.framework.apollo.tracer.Tracer;
......@@ -31,7 +31,7 @@ public class ClusterService {
}
ClusterDTO clusterDTO = clusterAPI.create(env, cluster);
Tracer.logEvent(CatEventType.CREATE_CLUSTER, cluster.getAppId(), "0", cluster.getName());
Tracer.logEvent(TracerEventType.CREATE_CLUSTER, cluster.getAppId(), "0", cluster.getName());
return clusterDTO;
}
......
......@@ -11,7 +11,7 @@ import com.ctrip.framework.apollo.core.enums.Env;
import com.ctrip.framework.apollo.core.utils.StringUtils;
import com.ctrip.framework.apollo.portal.api.AdminServiceAPI;
import com.ctrip.framework.apollo.portal.component.txtresolver.ConfigTextResolver;
import com.ctrip.framework.apollo.portal.constant.CatEventType;
import com.ctrip.framework.apollo.portal.constant.TracerEventType;
import com.ctrip.framework.apollo.portal.entity.model.NamespaceTextModel;
import com.ctrip.framework.apollo.portal.entity.vo.ItemDiffs;
import com.ctrip.framework.apollo.portal.entity.vo.NamespaceIdentifier;
......@@ -73,9 +73,9 @@ public class ItemService {
changeSets.setDataChangeLastModifiedBy(userInfoHolder.getUser().getUserId());
updateItems(appId, env, clusterName, namespaceName, changeSets);
Tracer.logEvent(CatEventType.MODIFY_NAMESPACE_BY_TEXT,
Tracer.logEvent(TracerEventType.MODIFY_NAMESPACE_BY_TEXT,
String.format("%s+%s+%s+%s", appId, env, clusterName, namespaceName));
Tracer.logEvent(CatEventType.MODIFY_NAMESPACE, String.format("%s+%s+%s+%s", appId, env, clusterName, namespaceName));
Tracer.logEvent(TracerEventType.MODIFY_NAMESPACE, String.format("%s+%s+%s+%s", appId, env, clusterName, namespaceName));
}
public void updateItems(String appId, Env env, String clusterName, String namespaceName, ItemChangeSets changeSets){
......@@ -92,7 +92,7 @@ public class ItemService {
item.setNamespaceId(namespace.getId());
ItemDTO itemDTO = itemAPI.createItem(appId, env, clusterName, namespaceName, item);
Tracer.logEvent(CatEventType.MODIFY_NAMESPACE, String.format("%s+%s+%s+%s", appId, env, clusterName, namespaceName));
Tracer.logEvent(TracerEventType.MODIFY_NAMESPACE, String.format("%s+%s+%s+%s", appId, env, clusterName, namespaceName));
return itemDTO;
}
......@@ -126,7 +126,7 @@ public class ItemService {
itemAPI.updateItemsByChangeSet(appId, env, clusterName, namespaceName, changeSets);
Tracer.logEvent(CatEventType.SYNC_NAMESPACE, String.format("%s+%s+%s+%s", appId, env, clusterName, namespaceName));
Tracer.logEvent(TracerEventType.SYNC_NAMESPACE, String.format("%s+%s+%s+%s", appId, env, clusterName, namespaceName));
}
}
......
......@@ -9,7 +9,7 @@ import com.ctrip.framework.apollo.common.exception.BadRequestException;
import com.ctrip.framework.apollo.core.enums.Env;
import com.ctrip.framework.apollo.portal.api.AdminServiceAPI;
import com.ctrip.framework.apollo.portal.component.ItemsComparator;
import com.ctrip.framework.apollo.portal.constant.CatEventType;
import com.ctrip.framework.apollo.portal.constant.TracerEventType;
import com.ctrip.framework.apollo.portal.entity.bo.NamespaceBO;
import com.ctrip.framework.apollo.portal.spi.UserInfoHolder;
import com.ctrip.framework.apollo.tracer.Tracer;
......@@ -43,7 +43,7 @@ public class NamespaceBranchService {
NamespaceDTO createdBranch = namespaceBranchAPI.createBranch(appId, env, parentClusterName, namespaceName,
userInfoHolder.getUser().getUserId());
Tracer.logEvent(CatEventType.CREATE_GRAY_RELEASE, String.format("%s+%s+%s+%s", appId, env, parentClusterName,
Tracer.logEvent(TracerEventType.CREATE_GRAY_RELEASE, String.format("%s+%s+%s+%s", appId, env, parentClusterName,
namespaceName));
return createdBranch;
......@@ -64,7 +64,7 @@ public class NamespaceBranchService {
namespaceBranchAPI.updateBranchGrayRules(appId, env, clusterName, namespaceName, branchName, rules);
Tracer.logEvent(CatEventType.UPDATE_GRAY_RELEASE_RULE,
Tracer.logEvent(TracerEventType.UPDATE_GRAY_RELEASE_RULE,
String.format("%s+%s+%s+%s", appId, env, clusterName, namespaceName));
}
......@@ -75,7 +75,7 @@ public class NamespaceBranchService {
namespaceBranchAPI.deleteBranch(appId, env, clusterName, namespaceName, branchName, operator);
Tracer.logEvent(CatEventType.DELETE_GRAY_RELEASE,
Tracer.logEvent(TracerEventType.DELETE_GRAY_RELEASE,
String.format("%s+%s+%s+%s", appId, env, clusterName, namespaceName));
}
......@@ -90,7 +90,7 @@ public class NamespaceBranchService {
releaseService.updateAndPublish(appId, env, clusterName, namespaceName, title, comment,
branchName, isEmergencyPublish, deleteBranch, changeSets);
Tracer.logEvent(CatEventType.MERGE_GRAY_RELEASE,
Tracer.logEvent(TracerEventType.MERGE_GRAY_RELEASE,
String.format("%s+%s+%s+%s", appId, env, clusterName, namespaceName));
return mergedResult;
......
......@@ -17,7 +17,7 @@ import com.ctrip.framework.apollo.core.enums.Env;
import com.ctrip.framework.apollo.core.utils.StringUtils;
import com.ctrip.framework.apollo.portal.api.AdminServiceAPI;
import com.ctrip.framework.apollo.portal.component.PortalSettings;
import com.ctrip.framework.apollo.portal.constant.CatEventType;
import com.ctrip.framework.apollo.portal.constant.TracerEventType;
import com.ctrip.framework.apollo.portal.entity.bo.ItemBO;
import com.ctrip.framework.apollo.portal.entity.bo.NamespaceBO;
import com.ctrip.framework.apollo.portal.spi.UserInfoHolder;
......@@ -64,7 +64,7 @@ public class NamespaceService {
namespace.setDataChangeLastModifiedBy(userInfoHolder.getUser().getUserId());
NamespaceDTO createdNamespace = namespaceAPI.createNamespace(env, namespace);
Tracer.logEvent(CatEventType.CREATE_NAMESPACE,
Tracer.logEvent(TracerEventType.CREATE_NAMESPACE,
String.format("%s+%s+%s+%s", namespace.getAppId(), env, namespace.getClusterName(),
namespace.getNamespaceName()));
return createdNamespace;
......
......@@ -9,7 +9,7 @@ import com.ctrip.framework.apollo.common.dto.ReleaseDTO;
import com.ctrip.framework.apollo.core.enums.Env;
import com.ctrip.framework.apollo.core.utils.StringUtils;
import com.ctrip.framework.apollo.portal.api.AdminServiceAPI;
import com.ctrip.framework.apollo.portal.constant.CatEventType;
import com.ctrip.framework.apollo.portal.constant.TracerEventType;
import com.ctrip.framework.apollo.portal.entity.model.NamespaceReleaseModel;
import com.ctrip.framework.apollo.portal.entity.bo.KVEntity;
import com.ctrip.framework.apollo.portal.entity.vo.ReleaseCompareResult;
......@@ -54,7 +54,7 @@ public class ReleaseService {
model.getReleaseTitle(), model.getReleaseComment(),
releaseBy, isEmergencyPublish);
Tracer.logEvent(CatEventType.RELEASE_NAMESPACE,
Tracer.logEvent(TracerEventType.RELEASE_NAMESPACE,
String.format("%s+%s+%s+%s", appId, env, clusterName, namespaceName));
return releaseDTO;
......
package com.ctrip.framework.apollo.portal.spi.ctrip.filters;
import com.ctrip.framework.apollo.portal.constant.CatEventType;
import com.ctrip.framework.apollo.portal.constant.TracerEventType;
import com.ctrip.framework.apollo.portal.entity.bo.UserInfo;
import com.ctrip.framework.apollo.portal.spi.UserInfoHolder;
import com.ctrip.framework.apollo.tracer.Tracer;
......@@ -37,7 +37,7 @@ public class UserAccessFilter implements Filter {
if (!isOpenAPIRequest(requestUri) && !isStaticResource(requestUri)) {
UserInfo userInfo = userInfoHolder.getUser();
if (userInfo != null) {
Tracer.logEvent(CatEventType.USER_ACCESS, userInfo.getUserId());
Tracer.logEvent(TracerEventType.USER_ACCESS, userInfo.getUserId());
}
}
} catch (Throwable e) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册