Commit 98c5ddbf by powerYao

CatEventType 名字修正

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