Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
superrain51
apollo
提交
89427dc5
apollo
项目概览
superrain51
/
apollo
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
apollo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
89427dc5
编写于
8月 21, 2017
作者:
J
Jason Song
提交者:
GitHub
8月 21, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #709 from powerYao/req_master
Update CatEventType to TracerEventType
上级
933150a9
98c5ddbf
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
24 addition
and
25 deletion
+24
-25
apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/service/AppService.java
...va/com/ctrip/framework/apollo/biz/service/AppService.java
+0
-1
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/component/RetryableRestTemplate.java
...mework/apollo/portal/component/RetryableRestTemplate.java
+3
-3
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/constant/TracerEventType.java
...rip/framework/apollo/portal/constant/TracerEventType.java
+1
-1
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/AppService.java
...com/ctrip/framework/apollo/portal/service/AppService.java
+2
-2
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/ClusterService.java
...ctrip/framework/apollo/portal/service/ClusterService.java
+2
-2
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/ItemService.java
...om/ctrip/framework/apollo/portal/service/ItemService.java
+5
-5
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/NamespaceBranchService.java
...amework/apollo/portal/service/NamespaceBranchService.java
+5
-5
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/NamespaceService.java
...rip/framework/apollo/portal/service/NamespaceService.java
+2
-2
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/ReleaseService.java
...ctrip/framework/apollo/portal/service/ReleaseService.java
+2
-2
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/ctrip/filters/UserAccessFilter.java
...ork/apollo/portal/spi/ctrip/filters/UserAccessFilter.java
+2
-2
未找到文件。
apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/service/AppService.java
浏览文件 @
89427dc5
...
...
@@ -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
;
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/component/RetryableRestTemplate.java
浏览文件 @
89427dc5
...
...
@@ -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.
Cat
EventType
;
import
com.ctrip.framework.apollo.portal.constant.
Tracer
EventType
;
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
(
Cat
EventType
.
API_RETRY
,
uri
);
Tracer
.
logEvent
(
Tracer
EventType
.
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
(
Cat
EventType
.
API_RETRY
,
uri
);
Tracer
.
logEvent
(
Tracer
EventType
.
API_RETRY
,
uri
);
}
else
{
// biz exception rethrow
ct
.
setStatus
(
t
);
ct
.
complete
();
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/constant/
Cat
EventType.java
→
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/constant/
Tracer
EventType.java
浏览文件 @
89427dc5
package
com.ctrip.framework.apollo.portal.constant
;
public
interface
Cat
EventType
{
public
interface
Tracer
EventType
{
String
RELEASE_NAMESPACE
=
"Namespace.Release"
;
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/AppService.java
浏览文件 @
89427dc5
...
...
@@ -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.
Cat
EventType
;
import
com.ctrip.framework.apollo.portal.constant.
Tracer
EventType
;
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
(
Cat
EventType
.
CREATE_APP
,
appId
);
Tracer
.
logEvent
(
Tracer
EventType
.
CREATE_APP
,
appId
);
return
createdApp
;
}
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/ClusterService.java
浏览文件 @
89427dc5
...
...
@@ -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.
Cat
EventType
;
import
com.ctrip.framework.apollo.portal.constant.
Tracer
EventType
;
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
(
Cat
EventType
.
CREATE_CLUSTER
,
cluster
.
getAppId
(),
"0"
,
cluster
.
getName
());
Tracer
.
logEvent
(
Tracer
EventType
.
CREATE_CLUSTER
,
cluster
.
getAppId
(),
"0"
,
cluster
.
getName
());
return
clusterDTO
;
}
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/ItemService.java
浏览文件 @
89427dc5
...
...
@@ -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.
Cat
EventType
;
import
com.ctrip.framework.apollo.portal.constant.
Tracer
EventType
;
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
(
Cat
EventType
.
MODIFY_NAMESPACE_BY_TEXT
,
Tracer
.
logEvent
(
Tracer
EventType
.
MODIFY_NAMESPACE_BY_TEXT
,
String
.
format
(
"%s+%s+%s+%s"
,
appId
,
env
,
clusterName
,
namespaceName
));
Tracer
.
logEvent
(
Cat
EventType
.
MODIFY_NAMESPACE
,
String
.
format
(
"%s+%s+%s+%s"
,
appId
,
env
,
clusterName
,
namespaceName
));
Tracer
.
logEvent
(
Tracer
EventType
.
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
(
Cat
EventType
.
MODIFY_NAMESPACE
,
String
.
format
(
"%s+%s+%s+%s"
,
appId
,
env
,
clusterName
,
namespaceName
));
Tracer
.
logEvent
(
Tracer
EventType
.
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
(
Cat
EventType
.
SYNC_NAMESPACE
,
String
.
format
(
"%s+%s+%s+%s"
,
appId
,
env
,
clusterName
,
namespaceName
));
Tracer
.
logEvent
(
Tracer
EventType
.
SYNC_NAMESPACE
,
String
.
format
(
"%s+%s+%s+%s"
,
appId
,
env
,
clusterName
,
namespaceName
));
}
}
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/NamespaceBranchService.java
浏览文件 @
89427dc5
...
...
@@ -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.
Cat
EventType
;
import
com.ctrip.framework.apollo.portal.constant.
Tracer
EventType
;
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
(
Cat
EventType
.
CREATE_GRAY_RELEASE
,
String
.
format
(
"%s+%s+%s+%s"
,
appId
,
env
,
parentClusterName
,
Tracer
.
logEvent
(
Tracer
EventType
.
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
(
Cat
EventType
.
UPDATE_GRAY_RELEASE_RULE
,
Tracer
.
logEvent
(
Tracer
EventType
.
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
(
Cat
EventType
.
DELETE_GRAY_RELEASE
,
Tracer
.
logEvent
(
Tracer
EventType
.
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
(
Cat
EventType
.
MERGE_GRAY_RELEASE
,
Tracer
.
logEvent
(
Tracer
EventType
.
MERGE_GRAY_RELEASE
,
String
.
format
(
"%s+%s+%s+%s"
,
appId
,
env
,
clusterName
,
namespaceName
));
return
mergedResult
;
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/NamespaceService.java
浏览文件 @
89427dc5
...
...
@@ -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.
Cat
EventType
;
import
com.ctrip.framework.apollo.portal.constant.
Tracer
EventType
;
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
(
Cat
EventType
.
CREATE_NAMESPACE
,
Tracer
.
logEvent
(
Tracer
EventType
.
CREATE_NAMESPACE
,
String
.
format
(
"%s+%s+%s+%s"
,
namespace
.
getAppId
(),
env
,
namespace
.
getClusterName
(),
namespace
.
getNamespaceName
()));
return
createdNamespace
;
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/ReleaseService.java
浏览文件 @
89427dc5
...
...
@@ -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.
Cat
EventType
;
import
com.ctrip.framework.apollo.portal.constant.
Tracer
EventType
;
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
(
Cat
EventType
.
RELEASE_NAMESPACE
,
Tracer
.
logEvent
(
Tracer
EventType
.
RELEASE_NAMESPACE
,
String
.
format
(
"%s+%s+%s+%s"
,
appId
,
env
,
clusterName
,
namespaceName
));
return
releaseDTO
;
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/ctrip/filters/UserAccessFilter.java
浏览文件 @
89427dc5
package
com.ctrip.framework.apollo.portal.spi.ctrip.filters
;
import
com.ctrip.framework.apollo.portal.constant.
Cat
EventType
;
import
com.ctrip.framework.apollo.portal.constant.
Tracer
EventType
;
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
(
Cat
EventType
.
USER_ACCESS
,
userInfo
.
getUserId
());
Tracer
.
logEvent
(
Tracer
EventType
.
USER_ACCESS
,
userInfo
.
getUserId
());
}
}
}
catch
(
Throwable
e
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录