Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
山不在高_有仙则灵
SkyWalking
提交
4582e9d9
S
SkyWalking
项目概览
山不在高_有仙则灵
/
SkyWalking
与 Fork 源项目一致
Fork自
apache / SkyWalking
通知
12
Star
0
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
SkyWalking
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4582e9d9
编写于
9月 08, 2017
作者:
P
pengys5
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Support entry service id or entry service name argument to query service tree.
上级
8abad65f
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
142 addition
and
17 deletion
+142
-17
apm-collector/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/service/entry/ServiceEntrySpanListener.java
...stream/worker/service/entry/ServiceEntrySpanListener.java
+1
-5
apm-collector/apm-collector-storage/src/main/java/org/skywalking/apm/collector/storage/define/service/ServiceEntryDataDefine.java
...lector/storage/define/service/ServiceEntryDataDefine.java
+1
-1
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/cache/ServiceNameCache.java
...g/skywalking/apm/collector/ui/cache/ServiceNameCache.java
+1
-1
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/dao/IServiceReferenceDAO.java
...skywalking/apm/collector/ui/dao/IServiceReferenceDAO.java
+2
-0
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/dao/ServiceNameEsDAO.java
...org/skywalking/apm/collector/ui/dao/ServiceNameEsDAO.java
+3
-1
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/dao/ServiceReferenceEsDAO.java
...kywalking/apm/collector/ui/dao/ServiceReferenceEsDAO.java
+41
-2
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/dao/ServiceReferenceH2DAO.java
...kywalking/apm/collector/ui/dao/ServiceReferenceH2DAO.java
+4
-0
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/jetty/UIJettyModuleDefine.java
...kywalking/apm/collector/ui/jetty/UIJettyModuleDefine.java
+4
-2
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/jetty/handler/servicetree/ServiceTreeGetByIdHandler.java
.../jetty/handler/servicetree/ServiceTreeGetByIdHandler.java
+3
-3
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/jetty/handler/servicetree/ServiceTreeGetByNameHandler.java
...etty/handler/servicetree/ServiceTreeGetByNameHandler.java
+62
-0
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/service/ServiceTreeService.java
...ywalking/apm/collector/ui/service/ServiceTreeService.java
+5
-0
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/service/SpanService.java
.../org/skywalking/apm/collector/ui/service/SpanService.java
+8
-1
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/service/TraceStackService.java
...kywalking/apm/collector/ui/service/TraceStackService.java
+7
-1
未找到文件。
apm-collector/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/service/entry/ServiceEntrySpanListener.java
浏览文件 @
4582e9d9
...
...
@@ -58,11 +58,7 @@ public class ServiceEntrySpanListener implements RefsListener, FirstSpanListener
StreamModuleContext
context
=
(
StreamModuleContext
)
CollectorContextHelper
.
INSTANCE
.
getContext
(
StreamModuleGroupDefine
.
GROUP_NAME
);
if
(!
hasReference
&&
hasEntry
)
{
ServiceEntryDataDefine
.
ServiceEntry
serviceEntry
=
new
ServiceEntryDataDefine
.
ServiceEntry
();
if
(
entryServiceId
==
0
)
{
serviceEntry
.
setId
(
applicationId
+
Const
.
ID_SPLIT
+
entryServiceName
);
}
else
{
serviceEntry
.
setId
(
applicationId
+
Const
.
ID_SPLIT
+
entryServiceId
);
}
serviceEntry
.
setId
(
applicationId
+
Const
.
ID_SPLIT
+
entryServiceName
);
serviceEntry
.
setApplicationId
(
applicationId
);
serviceEntry
.
setEntryServiceId
(
entryServiceId
);
serviceEntry
.
setEntryServiceName
(
entryServiceName
);
...
...
apm-collector/apm-collector-storage/src/main/java/org/skywalking/apm/collector/storage/define/service/ServiceEntryDataDefine.java
浏览文件 @
4582e9d9
...
...
@@ -21,7 +21,7 @@ public class ServiceEntryDataDefine extends DataDefine {
@Override
protected
void
attributeDefine
()
{
addAttribute
(
0
,
new
Attribute
(
ServiceEntryTable
.
COLUMN_ID
,
AttributeType
.
STRING
,
new
NonOperation
()));
addAttribute
(
1
,
new
Attribute
(
ServiceEntryTable
.
COLUMN_APPLICATION_ID
,
AttributeType
.
INTEGER
,
new
NonOperation
()));
addAttribute
(
2
,
new
Attribute
(
ServiceEntryTable
.
COLUMN_ENTRY_SERVICE_ID
,
AttributeType
.
INTEGER
,
new
Non
Operation
()));
addAttribute
(
2
,
new
Attribute
(
ServiceEntryTable
.
COLUMN_ENTRY_SERVICE_ID
,
AttributeType
.
INTEGER
,
new
Cover
Operation
()));
addAttribute
(
3
,
new
Attribute
(
ServiceEntryTable
.
COLUMN_ENTRY_SERVICE_NAME
,
AttributeType
.
STRING
,
new
NonOperation
()));
addAttribute
(
4
,
new
Attribute
(
ServiceEntryTable
.
COLUMN_REGISTER_TIME
,
AttributeType
.
LONG
,
new
NonOperation
()));
addAttribute
(
5
,
new
Attribute
(
ServiceEntryTable
.
COLUMN_NEWEST_TIME
,
AttributeType
.
LONG
,
new
CoverOperation
()));
...
...
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/cache/ServiceNameCache.java
浏览文件 @
4582e9d9
...
...
@@ -12,7 +12,7 @@ import org.skywalking.apm.collector.ui.dao.IServiceNameDAO;
public
class
ServiceNameCache
{
//TODO size configuration
private
static
Cache
<
Integer
,
String
>
CACHE
=
CacheBuilder
.
newBuilder
().
maximumSize
(
1000
).
build
();
private
static
Cache
<
Integer
,
String
>
CACHE
=
CacheBuilder
.
newBuilder
().
maximumSize
(
1000
0
).
build
();
public
static
String
get
(
int
serviceId
)
{
try
{
...
...
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/dao/IServiceReferenceDAO.java
浏览文件 @
4582e9d9
...
...
@@ -7,4 +7,6 @@ import com.google.gson.JsonArray;
*/
public
interface
IServiceReferenceDAO
{
JsonArray
load
(
int
entryServiceId
,
long
startTime
,
long
endTime
);
JsonArray
load
(
String
entryServiceName
,
int
entryApplicationId
,
long
startTime
,
long
endTime
);
}
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/dao/ServiceNameEsDAO.java
浏览文件 @
4582e9d9
...
...
@@ -22,7 +22,9 @@ public class ServiceNameEsDAO extends EsDAO implements IServiceNameDAO {
GetResponse
getResponse
=
getRequestBuilder
.
get
();
if
(
getResponse
.
isExists
())
{
return
(
String
)
getResponse
.
getSource
().
get
(
ServiceNameTable
.
COLUMN_SERVICE_NAME
);
String
serviceName
=
(
String
)
getResponse
.
getSource
().
get
(
ServiceNameTable
.
COLUMN_SERVICE_NAME
);
int
applicationId
=
((
Number
)
getResponse
.
getSource
().
get
(
ServiceNameTable
.
COLUMN_APPLICATION_ID
)).
intValue
();
return
applicationId
+
Const
.
ID_SPLIT
+
serviceName
;
}
return
Const
.
UNKNOWN
;
}
...
...
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/dao/ServiceReferenceEsDAO.java
浏览文件 @
4582e9d9
...
...
@@ -27,18 +27,51 @@ public class ServiceReferenceEsDAO extends EsDAO implements IServiceReferenceDAO
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ServiceReferenceEsDAO
.
class
);
@Override
public
JsonArray
load
(
String
entryServiceName
,
int
entryApplicationId
,
long
startTime
,
long
endTime
)
{
SearchRequestBuilder
searchRequestBuilder
=
getClient
().
prepareSearch
(
ServiceReferenceTable
.
TABLE
);
searchRequestBuilder
.
setTypes
(
ServiceReferenceTable
.
TABLE_TYPE
);
searchRequestBuilder
.
setSearchType
(
SearchType
.
DFS_QUERY_THEN_FETCH
);
BoolQueryBuilder
boolQuery
=
QueryBuilders
.
boolQuery
();
boolQuery
.
must
().
add
(
QueryBuilders
.
rangeQuery
(
ServiceReferenceTable
.
COLUMN_TIME_BUCKET
).
gte
(
startTime
).
lte
(
endTime
));
boolQuery
.
must
().
add
(
QueryBuilders
.
rangeQuery
(
ServiceReferenceTable
.
COLUMN_TIME_BUCKET
).
gte
(
startTime
).
lte
(
endTime
));
int
entryServiceId
=
ServiceIdCache
.
get
(
entryApplicationId
,
entryServiceName
);
BoolQueryBuilder
entryBoolQuery
=
QueryBuilders
.
boolQuery
();
if
(
entryServiceId
!=
0
)
{
entryBoolQuery
.
should
().
add
(
QueryBuilders
.
matchQuery
(
ServiceReferenceTable
.
COLUMN_ENTRY_SERVICE_ID
,
entryServiceId
));
}
entryBoolQuery
.
should
().
add
(
QueryBuilders
.
matchQuery
(
ServiceReferenceTable
.
COLUMN_ENTRY_SERVICE_NAME
,
entryApplicationId
+
Const
.
ID_SPLIT
+
entryServiceName
));
boolQuery
.
must
(
entryBoolQuery
);
searchRequestBuilder
.
setQuery
(
boolQuery
);
searchRequestBuilder
.
setSize
(
0
);
return
load
(
searchRequestBuilder
);
}
@Override
public
JsonArray
load
(
int
entryServiceId
,
long
startTime
,
long
endTime
)
{
SearchRequestBuilder
searchRequestBuilder
=
getClient
().
prepareSearch
(
ServiceReferenceTable
.
TABLE
);
searchRequestBuilder
.
setTypes
(
ServiceReferenceTable
.
TABLE_TYPE
);
searchRequestBuilder
.
setSearchType
(
SearchType
.
DFS_QUERY_THEN_FETCH
);
BoolQueryBuilder
boolQuery
=
QueryBuilders
.
boolQuery
();
boolQuery
.
should
().
add
(
QueryBuilders
.
matchQuery
(
ServiceReferenceTable
.
COLUMN_ENTRY_SERVICE_ID
,
entryServiceId
));
boolQuery
.
should
().
add
(
QueryBuilders
.
matchQuery
(
ServiceReferenceTable
.
COLUMN_ENTRY_SERVICE_NAME
,
ServiceNameCache
.
getForUI
(
entryServiceId
)));
boolQuery
.
must
().
add
(
QueryBuilders
.
rangeQuery
(
ServiceReferenceTable
.
COLUMN_TIME_BUCKET
).
gte
(
startTime
).
lte
(
endTime
));
boolQuery
.
must
().
add
(
QueryBuilders
.
rangeQuery
(
ServiceReferenceTable
.
COLUMN_TIME_BUCKET
).
gte
(
startTime
).
lte
(
endTime
));
String
entryServiceName
=
ServiceNameCache
.
get
(
entryServiceId
);
BoolQueryBuilder
entryBoolQuery
=
QueryBuilders
.
boolQuery
();
entryBoolQuery
.
should
().
add
(
QueryBuilders
.
matchQuery
(
ServiceReferenceTable
.
COLUMN_ENTRY_SERVICE_ID
,
entryServiceId
));
entryBoolQuery
.
should
().
add
(
QueryBuilders
.
matchQuery
(
ServiceReferenceTable
.
COLUMN_ENTRY_SERVICE_NAME
,
entryServiceName
));
boolQuery
.
must
(
entryBoolQuery
);
searchRequestBuilder
.
setQuery
(
boolQuery
);
searchRequestBuilder
.
setSize
(
0
);
return
load
(
searchRequestBuilder
);
}
private
JsonArray
load
(
SearchRequestBuilder
searchRequestBuilder
)
{
searchRequestBuilder
.
addAggregation
(
AggregationBuilders
.
terms
(
ServiceReferenceTable
.
COLUMN_FRONT_SERVICE_ID
).
field
(
ServiceReferenceTable
.
COLUMN_FRONT_SERVICE_ID
).
size
(
100
)
.
subAggregation
(
AggregationBuilders
.
terms
(
ServiceReferenceTable
.
COLUMN_BEHIND_SERVICE_ID
).
field
(
ServiceReferenceTable
.
COLUMN_BEHIND_SERVICE_ID
).
size
(
100
)
.
subAggregation
(
AggregationBuilders
.
sum
(
ServiceReferenceTable
.
COLUMN_S1_LTE
).
field
(
ServiceReferenceTable
.
COLUMN_S1_LTE
))
...
...
@@ -112,7 +145,13 @@ public class ServiceReferenceEsDAO extends EsDAO implements IServiceReferenceDAO
Sum
costSum
=
behindServiceIdBucket
.
getAggregations
().
get
(
ServiceReferenceTable
.
COLUMN_COST_SUMMARY
);
String
frontServiceName
=
ServiceNameCache
.
getForUI
(
frontServiceId
);
if
(
StringUtils
.
isNotEmpty
(
frontServiceName
))
{
frontServiceName
=
frontServiceName
.
split
(
Const
.
ID_SPLIT
)[
1
];
}
String
behindServiceName
=
ServiceNameCache
.
getForUI
(
behindServiceId
);
if
(
StringUtils
.
isNotEmpty
(
frontServiceName
))
{
behindServiceName
=
behindServiceName
.
split
(
Const
.
ID_SPLIT
)[
1
];
}
JsonObject
serviceReference
=
new
JsonObject
();
serviceReference
.
addProperty
(
ColumnNameUtils
.
INSTANCE
.
rename
(
ServiceReferenceTable
.
COLUMN_FRONT_SERVICE_ID
),
frontServiceId
);
...
...
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/dao/ServiceReferenceH2DAO.java
浏览文件 @
4582e9d9
...
...
@@ -11,4 +11,8 @@ public class ServiceReferenceH2DAO extends H2DAO implements IServiceReferenceDAO
@Override
public
JsonArray
load
(
int
entryServiceId
,
long
startTime
,
long
endTime
)
{
return
null
;
}
@Override
public
JsonArray
load
(
String
entryServiceName
,
int
entryApplicationId
,
long
startTime
,
long
endTime
)
{
return
null
;
}
}
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/jetty/UIJettyModuleDefine.java
浏览文件 @
4582e9d9
...
...
@@ -21,7 +21,8 @@ import org.skywalking.apm.collector.ui.jetty.handler.instancemetric.InstanceMetr
import
org.skywalking.apm.collector.ui.jetty.handler.instancemetric.InstanceMetricGetRangeTimeBucketHandler
;
import
org.skywalking.apm.collector.ui.jetty.handler.instancemetric.InstanceOsInfoGetHandler
;
import
org.skywalking.apm.collector.ui.jetty.handler.servicetree.EntryServiceGetHandler
;
import
org.skywalking.apm.collector.ui.jetty.handler.servicetree.ServiceTreeGetHandler
;
import
org.skywalking.apm.collector.ui.jetty.handler.servicetree.ServiceTreeGetByIdHandler
;
import
org.skywalking.apm.collector.ui.jetty.handler.servicetree.ServiceTreeGetByNameHandler
;
import
org.skywalking.apm.collector.ui.jetty.handler.time.AllInstanceLastTimeGetHandler
;
import
org.skywalking.apm.collector.ui.jetty.handler.time.OneInstanceLastTimeGetHandler
;
...
...
@@ -71,7 +72,8 @@ public class UIJettyModuleDefine extends UIModuleDefine {
handlers
.
add
(
new
InstanceMetricGetOneTimeBucketHandler
());
handlers
.
add
(
new
InstanceMetricGetRangeTimeBucketHandler
());
handlers
.
add
(
new
EntryServiceGetHandler
());
handlers
.
add
(
new
ServiceTreeGetHandler
());
handlers
.
add
(
new
ServiceTreeGetByIdHandler
());
handlers
.
add
(
new
ServiceTreeGetByNameHandler
());
return
handlers
;
}
}
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/jetty/handler/servicetree/ServiceTreeGetHandler.java
→
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/jetty/handler/servicetree/ServiceTreeGet
ById
Handler.java
浏览文件 @
4582e9d9
...
...
@@ -11,12 +11,12 @@ import org.slf4j.LoggerFactory;
/**
* @author pengys5
*/
public
class
ServiceTreeGetHandler
extends
JettyHandler
{
public
class
ServiceTreeGet
ById
Handler
extends
JettyHandler
{
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ServiceTreeGetHandler
.
class
);
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ServiceTreeGet
ById
Handler
.
class
);
@Override
public
String
pathSpec
()
{
return
"/service/tree"
;
return
"/service/tree
/entryServiceId
"
;
}
private
ServiceTreeService
service
=
new
ServiceTreeService
();
...
...
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/jetty/handler/servicetree/ServiceTreeGetByNameHandler.java
0 → 100644
浏览文件 @
4582e9d9
package
org.skywalking.apm.collector.ui.jetty.handler.servicetree
;
import
com.google.gson.JsonElement
;
import
javax.servlet.http.HttpServletRequest
;
import
org.skywalking.apm.collector.server.jetty.ArgumentsParseException
;
import
org.skywalking.apm.collector.server.jetty.JettyHandler
;
import
org.skywalking.apm.collector.ui.service.ServiceTreeService
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
/**
* @author pengys5
*/
public
class
ServiceTreeGetByNameHandler
extends
JettyHandler
{
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ServiceTreeGetByNameHandler
.
class
);
@Override
public
String
pathSpec
()
{
return
"/service/tree/entryServiceName"
;
}
private
ServiceTreeService
service
=
new
ServiceTreeService
();
@Override
protected
JsonElement
doGet
(
HttpServletRequest
req
)
throws
ArgumentsParseException
{
if
(!
req
.
getParameterMap
().
containsKey
(
"entryServiceName"
)
||
!
req
.
getParameterMap
().
containsKey
(
"entryApplicationId"
)
||
!
req
.
getParameterMap
().
containsKey
(
"startTime"
)
||
!
req
.
getParameterMap
().
containsKey
(
"endTime"
))
{
throw
new
ArgumentsParseException
(
"must contains parameters: entryServiceName, entryApplicationId, startTime, endTime"
);
}
String
entryServiceName
=
req
.
getParameter
(
"entryServiceName"
);
String
entryApplicationIdStr
=
req
.
getParameter
(
"entryApplicationId"
);
String
startTimeStr
=
req
.
getParameter
(
"startTime"
);
String
endTimeStr
=
req
.
getParameter
(
"endTime"
);
logger
.
debug
(
"service entry get entryServiceName: {}, startTime: {}, endTime: {}"
,
entryServiceName
,
startTimeStr
,
endTimeStr
);
int
entryApplicationId
;
try
{
entryApplicationId
=
Integer
.
parseInt
(
entryApplicationIdStr
);
}
catch
(
NumberFormatException
e
)
{
throw
new
ArgumentsParseException
(
"entry application id must be integer"
);
}
long
startTime
;
try
{
startTime
=
Long
.
parseLong
(
startTimeStr
);
}
catch
(
NumberFormatException
e
)
{
throw
new
ArgumentsParseException
(
"start time must be long"
);
}
long
endTime
;
try
{
endTime
=
Long
.
parseLong
(
endTimeStr
);
}
catch
(
NumberFormatException
e
)
{
throw
new
ArgumentsParseException
(
"end time must be long"
);
}
return
service
.
loadServiceTree
(
entryServiceName
,
entryApplicationId
,
startTime
,
endTime
);
}
@Override
protected
JsonElement
doPost
(
HttpServletRequest
req
)
throws
ArgumentsParseException
{
throw
new
UnsupportedOperationException
();
}
}
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/service/ServiceTreeService.java
浏览文件 @
4582e9d9
...
...
@@ -21,4 +21,9 @@ public class ServiceTreeService {
IServiceReferenceDAO
serviceReferenceDAO
=
(
IServiceReferenceDAO
)
DAOContainer
.
INSTANCE
.
get
(
IServiceReferenceDAO
.
class
.
getName
());
return
serviceReferenceDAO
.
load
(
entryServiceId
,
startTime
,
endTime
);
}
public
JsonArray
loadServiceTree
(
String
entryServiceName
,
int
entryApplicationId
,
long
startTime
,
long
endTime
)
{
IServiceReferenceDAO
serviceReferenceDAO
=
(
IServiceReferenceDAO
)
DAOContainer
.
INSTANCE
.
get
(
IServiceReferenceDAO
.
class
.
getName
());
return
serviceReferenceDAO
.
load
(
entryServiceName
,
entryApplicationId
,
startTime
,
endTime
);
}
}
\ No newline at end of file
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/service/SpanService.java
浏览文件 @
4582e9d9
...
...
@@ -3,6 +3,8 @@ package org.skywalking.apm.collector.ui.service;
import
com.google.gson.JsonArray
;
import
com.google.gson.JsonObject
;
import
java.util.List
;
import
org.skywalking.apm.collector.core.util.Const
;
import
org.skywalking.apm.collector.core.util.StringUtils
;
import
org.skywalking.apm.collector.storage.dao.DAOContainer
;
import
org.skywalking.apm.collector.ui.cache.ServiceNameCache
;
import
org.skywalking.apm.collector.ui.dao.ISegmentDAO
;
...
...
@@ -26,7 +28,12 @@ public class SpanService {
if
(
spanId
==
spanObject
.
getSpanId
())
{
String
operationName
=
spanObject
.
getOperationName
();
if
(
spanObject
.
getOperationNameId
()
!=
0
)
{
operationName
=
ServiceNameCache
.
get
(
spanObject
.
getOperationNameId
());
String
serviceName
=
ServiceNameCache
.
get
(
spanObject
.
getOperationNameId
());
if
(
StringUtils
.
isNotEmpty
(
serviceName
))
{
operationName
=
serviceName
.
split
(
Const
.
ID_SPLIT
)[
1
];
}
else
{
operationName
=
Const
.
EMPTY_STRING
;
}
}
spanJson
.
addProperty
(
"operationName"
,
operationName
);
spanJson
.
addProperty
(
"startTime"
,
spanObject
.
getStartTime
());
...
...
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/service/TraceStackService.java
浏览文件 @
4582e9d9
...
...
@@ -7,6 +7,7 @@ import java.util.List;
import
org.skywalking.apm.collector.core.util.CollectionUtils
;
import
org.skywalking.apm.collector.core.util.Const
;
import
org.skywalking.apm.collector.core.util.ObjectUtils
;
import
org.skywalking.apm.collector.core.util.StringUtils
;
import
org.skywalking.apm.collector.storage.dao.DAOContainer
;
import
org.skywalking.apm.collector.ui.cache.ApplicationCache
;
import
org.skywalking.apm.collector.ui.cache.ServiceNameCache
;
...
...
@@ -98,7 +99,12 @@ public class TraceStackService {
String
operationName
=
spanObject
.
getOperationName
();
if
(
spanObject
.
getOperationNameId
()
!=
0
)
{
operationName
=
ServiceNameCache
.
get
(
spanObject
.
getOperationNameId
());
String
serviceName
=
ServiceNameCache
.
get
(
spanObject
.
getOperationNameId
());
if
(
StringUtils
.
isNotEmpty
(
serviceName
))
{
operationName
=
serviceName
.
split
(
Const
.
ID_SPLIT
)[
1
];
}
else
{
operationName
=
Const
.
EMPTY_STRING
;
}
}
String
applicationCode
=
ApplicationCache
.
get
(
segment
.
getApplicationId
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录