Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
killuaz丶x
SkyWalking
提交
4cae884f
S
SkyWalking
项目概览
killuaz丶x
/
SkyWalking
与 Fork 源项目一致
Fork自
apache / SkyWalking
通知
1
Star
0
Fork
0
代码
文件
提交
分支
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,发现更多精彩内容 >>
未验证
提交
4cae884f
编写于
9月 28, 2018
作者:
wu-sheng
提交者:
GitHub
9月 28, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add endpoint id to trace query. (#1722)
上级
04d0f554
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
20 addition
and
8 deletion
+20
-8
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/manual/segment/SegmentDispatcher.java
...erver/core/analysis/manual/segment/SegmentDispatcher.java
+1
-0
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/manual/segment/SegmentRecord.java
...ap/server/core/analysis/manual/segment/SegmentRecord.java
+2
-0
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/TraceQueryService.java
...e/skywalking/oap/server/core/query/TraceQueryService.java
+3
-2
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/Segment.java
...org/apache/skywalking/oap/server/core/source/Segment.java
+1
-0
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/query/ITraceQueryDAO.java
...walking/oap/server/core/storage/query/ITraceQueryDAO.java
+1
-1
oap-server/server-query-plugin/query-graphql-plugin/src/main/java/org/apache/skywalking/oap/query/graphql/resolver/TraceQuery.java
...che/skywalking/oap/query/graphql/resolver/TraceQuery.java
+3
-2
oap-server/server-query-plugin/query-graphql-plugin/src/main/java/org/apache/skywalking/oap/query/graphql/type/TraceQueryCondition.java
...kywalking/oap/query/graphql/type/TraceQueryCondition.java
+2
-1
oap-server/server-query-plugin/query-graphql-plugin/src/main/resources/query-protocol
...in/query-graphql-plugin/src/main/resources/query-protocol
+1
-1
oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/listener/segment/SegmentSpanListener.java
...provider/parser/listener/segment/SegmentSpanListener.java
+2
-0
oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/TraceQueryEsDAO.java
...r/storage/plugin/elasticsearch/query/TraceQueryEsDAO.java
+4
-1
未找到文件。
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/manual/segment/SegmentDispatcher.java
浏览文件 @
4cae884f
...
...
@@ -33,6 +33,7 @@ public class SegmentDispatcher implements SourceDispatcher<Segment> {
segment
.
setTraceId
(
source
.
getTraceId
());
segment
.
setServiceId
(
source
.
getServiceId
());
segment
.
setEndpointName
(
source
.
getEndpointName
());
segment
.
setEndpointId
(
source
.
getEndpointId
());
segment
.
setStartTime
(
source
.
getStartTime
());
segment
.
setEndTime
(
source
.
getEndTime
());
segment
.
setLatency
(
source
.
getLatency
());
...
...
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/manual/segment/SegmentRecord.java
浏览文件 @
4cae884f
...
...
@@ -40,6 +40,7 @@ public class SegmentRecord extends Record {
public
static
final
String
TRACE_ID
=
"trace_id"
;
public
static
final
String
SERVICE_ID
=
"service_id"
;
public
static
final
String
ENDPOINT_NAME
=
"endpoint_name"
;
public
static
final
String
ENDPOINT_ID
=
"endpoint_id"
;
public
static
final
String
START_TIME
=
"start_time"
;
public
static
final
String
END_TIME
=
"end_time"
;
public
static
final
String
LATENCY
=
"latency"
;
...
...
@@ -50,6 +51,7 @@ public class SegmentRecord extends Record {
@Setter
@Getter
@Column
(
columnName
=
TRACE_ID
)
@IDColumn
private
String
traceId
;
@Setter
@Getter
@Column
(
columnName
=
SERVICE_ID
)
@IDColumn
private
int
serviceId
;
@Setter
@Getter
@Column
(
columnName
=
ENDPOINT_NAME
)
@IDColumn
private
String
endpointName
;
@Setter
@Getter
@Column
(
columnName
=
ENDPOINT_ID
)
@IDColumn
private
int
endpointId
;
@Setter
@Getter
@Column
(
columnName
=
START_TIME
)
@IDColumn
private
long
startTime
;
@Setter
@Getter
@Column
(
columnName
=
END_TIME
)
@IDColumn
private
long
endTime
;
@Setter
@Getter
@Column
(
columnName
=
LATENCY
)
@IDColumn
private
int
latency
;
...
...
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/TraceQueryService.java
浏览文件 @
4cae884f
...
...
@@ -87,12 +87,13 @@ public class TraceQueryService implements Service {
return
componentLibraryCatalogService
;
}
public
TraceBrief
queryBasicTraces
(
final
int
serviceId
,
final
String
traceId
,
final
String
endpointName
,
public
TraceBrief
queryBasicTraces
(
final
int
serviceId
,
final
int
endpointId
,
final
String
traceId
,
final
String
endpointName
,
final
int
minTraceDuration
,
int
maxTraceDuration
,
final
TraceState
traceState
,
final
QueryOrder
queryOrder
,
final
Pagination
paging
,
final
long
startTB
,
final
long
endTB
)
throws
IOException
{
PaginationUtils
.
Page
page
=
PaginationUtils
.
INSTANCE
.
exchange
(
paging
);
return
getTraceQueryDAO
().
queryBasicTraces
(
startTB
,
endTB
,
minTraceDuration
,
maxTraceDuration
,
endpointName
,
serviceId
,
traceId
,
page
.
getLimit
(),
page
.
getFrom
(),
traceState
,
queryOrder
);
return
getTraceQueryDAO
().
queryBasicTraces
(
startTB
,
endTB
,
minTraceDuration
,
maxTraceDuration
,
endpointName
,
serviceId
,
endpointId
,
traceId
,
page
.
getLimit
(),
page
.
getFrom
(),
traceState
,
queryOrder
);
}
public
Trace
queryTrace
(
final
String
traceId
)
throws
IOException
{
...
...
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/Segment.java
浏览文件 @
4cae884f
...
...
@@ -39,6 +39,7 @@ public class Segment extends Source {
@Setter
@Getter
private
String
traceId
;
@Setter
@Getter
private
int
serviceId
;
@Setter
@Getter
private
String
endpointName
;
@Setter
@Getter
private
int
endpointId
;
@Setter
@Getter
private
long
startTime
;
@Setter
@Getter
private
long
endTime
;
@Setter
@Getter
private
int
latency
;
...
...
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/query/ITraceQueryDAO.java
浏览文件 @
4cae884f
...
...
@@ -30,7 +30,7 @@ import org.apache.skywalking.oap.server.library.module.Service;
public
interface
ITraceQueryDAO
extends
Service
{
TraceBrief
queryBasicTraces
(
long
startSecondTB
,
long
endSecondTB
,
long
minDuration
,
long
maxDuration
,
String
endpointName
,
int
serviceId
,
String
traceId
,
int
limit
,
int
from
,
long
maxDuration
,
String
endpointName
,
int
serviceId
,
int
endpointId
,
String
traceId
,
int
limit
,
int
from
,
TraceState
traceState
,
QueryOrder
queryOrder
)
throws
IOException
;
List
<
SegmentRecord
>
queryByTraceId
(
String
traceId
)
throws
IOException
;
...
...
oap-server/server-query-plugin/query-graphql-plugin/src/main/java/org/apache/skywalking/oap/query/graphql/resolver/TraceQuery.java
浏览文件 @
4cae884f
...
...
@@ -62,12 +62,13 @@ public class TraceQuery implements GraphQLQueryResolver {
int
minDuration
=
condition
.
getMinTraceDuration
();
int
maxDuration
=
condition
.
getMaxTraceDuration
();
String
endpointName
=
condition
.
getEndpointName
();
int
serviceId
=
condition
.
getServiceId
();
int
serviceId
=
StringUtils
.
isEmpty
(
condition
.
getServiceId
())
?
0
:
Integer
.
parseInt
(
condition
.
getServiceId
());
int
endpointId
=
StringUtils
.
isEmpty
(
condition
.
getEndpointId
())
?
0
:
Integer
.
parseInt
(
condition
.
getEndpointId
());
TraceState
traceState
=
condition
.
getTraceState
();
QueryOrder
queryOrder
=
condition
.
getQueryOrder
();
Pagination
pagination
=
condition
.
getPaging
();
return
getQueryService
().
queryBasicTraces
(
serviceId
,
traceId
,
endpointName
,
minDuration
,
maxDuration
,
traceState
,
queryOrder
,
pagination
,
startSecondTB
,
endSecondTB
);
return
getQueryService
().
queryBasicTraces
(
serviceId
,
endpointId
,
traceId
,
endpointName
,
minDuration
,
maxDuration
,
traceState
,
queryOrder
,
pagination
,
startSecondTB
,
endSecondTB
);
}
public
Trace
queryTrace
(
final
String
traceId
)
throws
IOException
{
...
...
oap-server/server-query-plugin/query-graphql-plugin/src/main/java/org/apache/skywalking/oap/query/graphql/type/TraceQueryCondition.java
浏览文件 @
4cae884f
...
...
@@ -24,9 +24,10 @@ import org.apache.skywalking.oap.server.core.query.entity.*;
@Getter
@Setter
public
class
TraceQueryCondition
{
private
int
serviceId
;
private
String
serviceId
;
private
String
traceId
;
private
String
endpointName
;
private
String
endpointId
;
private
Duration
queryDuration
;
private
int
minTraceDuration
;
private
int
maxTraceDuration
;
...
...
query-protocol
@
3a83be79
比较
d71d3f18
...
3a83be79
Subproject commit
d71d3f183a1e498aafad8c59c8d3373408140ac
9
Subproject commit
3a83be79a9c23aad6576ed2a4a04b82de6d7a82
9
oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/listener/segment/SegmentSpanListener.java
浏览文件 @
4cae884f
...
...
@@ -89,8 +89,10 @@ public class SegmentSpanListener implements FirstSpanListener, EntrySpanListener
}
if
(
entryEndpointId
==
0
)
{
segment
.
setEndpointId
(
firstEndpointId
);
segment
.
setEndpointName
(
serviceNameCacheService
.
get
(
firstEndpointId
).
getName
());
}
else
{
segment
.
setEndpointId
(
entryEndpointId
);
segment
.
setEndpointName
(
serviceNameCacheService
.
get
(
entryEndpointId
).
getName
());
}
...
...
oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/TraceQueryEsDAO.java
浏览文件 @
4cae884f
...
...
@@ -43,7 +43,7 @@ public class TraceQueryEsDAO extends EsDAO implements ITraceQueryDAO {
@Override
public
TraceBrief
queryBasicTraces
(
long
startSecondTB
,
long
endSecondTB
,
long
minDuration
,
long
maxDuration
,
String
endpointName
,
int
serviceId
,
String
traceId
,
int
limit
,
int
from
,
long
maxDuration
,
String
endpointName
,
int
serviceId
,
int
endpointId
,
String
traceId
,
int
limit
,
int
from
,
TraceState
traceState
,
QueryOrder
queryOrder
)
throws
IOException
{
SearchSourceBuilder
sourceBuilder
=
SearchSourceBuilder
.
searchSource
();
...
...
@@ -71,6 +71,9 @@ public class TraceQueryEsDAO extends EsDAO implements ITraceQueryDAO {
if
(
serviceId
!=
0
)
{
boolQueryBuilder
.
must
().
add
(
QueryBuilders
.
termQuery
(
SegmentRecord
.
SERVICE_ID
,
serviceId
));
}
if
(
endpointId
!=
0
)
{
boolQueryBuilder
.
must
().
add
(
QueryBuilders
.
termQuery
(
SegmentRecord
.
ENDPOINT_ID
,
endpointId
));
}
if
(
StringUtils
.
isNotEmpty
(
traceId
))
{
boolQueryBuilder
.
must
().
add
(
QueryBuilders
.
termQuery
(
SegmentRecord
.
TRACE_ID
,
traceId
));
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录