Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
SkyWalking
提交
929dc0e9
S
SkyWalking
项目概览
apache
/
SkyWalking
上一次同步 1 年多
通知
302
Star
21345
Fork
6091
代码
文件
提交
分支
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,体验更适合开发者的 AI 搜索 >>
未验证
提交
929dc0e9
编写于
10月 21, 2021
作者:
Z
zhang-wei
提交者:
GitHub
10月 21, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
support search browser service (#7975)
上级
2fb4fe1b
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
48 addition
and
18 deletion
+48
-18
CHANGES.md
CHANGES.md
+1
-0
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/MetadataQueryService.java
...kywalking/oap/server/core/query/MetadataQueryService.java
+18
-2
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/query/IMetadataQueryDAO.java
...king/oap/server/core/storage/query/IMetadataQueryDAO.java
+6
-3
oap-server/server-query-plugin/query-graphql-plugin/src/main/java/org/apache/skywalking/oap/query/graphql/resolver/MetadataQuery.java
.../skywalking/oap/query/graphql/resolver/MetadataQuery.java
+10
-0
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-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/MetadataQueryEsDAO.java
...torage/plugin/elasticsearch/query/MetadataQueryEsDAO.java
+4
-4
oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/query/MetadataQuery.java
...p/server/storage/plugin/influxdb/query/MetadataQuery.java
+4
-4
oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/h2/dao/H2MetadataQueryDAO.java
...server/storage/plugin/jdbc/h2/dao/H2MetadataQueryDAO.java
+4
-4
未找到文件。
CHANGES.md
浏览文件 @
929dc0e9
...
...
@@ -46,6 +46,7 @@ Release Notes.
*
Add
`Message Queue Avg Consuming Latency`
metric for MQ consuming service and endpoint.
*
Support
`-Inf`
as bucket in the meter system.
*
Fix setting wrong field when combining
`Event`
s.
*
Support search browser service.
#### UI
...
...
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/MetadataQueryService.java
浏览文件 @
929dc0e9
...
...
@@ -23,6 +23,7 @@ import java.util.List;
import
java.util.stream.Collectors
;
import
org.apache.skywalking.oap.server.core.Const
;
import
org.apache.skywalking.oap.server.core.analysis.IDManager
;
import
org.apache.skywalking.oap.server.core.analysis.NodeType
;
import
org.apache.skywalking.oap.server.core.query.type.Database
;
import
org.apache.skywalking.oap.server.core.query.type.Endpoint
;
import
org.apache.skywalking.oap.server.core.query.type.EndpointInfo
;
...
...
@@ -69,7 +70,18 @@ public class MetadataQueryService implements org.apache.skywalking.oap.server.li
public
List
<
Service
>
searchServices
(
final
long
startTimestamp
,
final
long
endTimestamp
,
final
String
keyword
)
throws
IOException
{
return
getMetadataQueryDAO
().
searchServices
(
keyword
).
stream
().
distinct
().
collect
(
Collectors
.
toList
());
return
getMetadataQueryDAO
().
searchServices
(
NodeType
.
Normal
,
keyword
)
.
stream
()
.
distinct
()
.
collect
(
Collectors
.
toList
());
}
public
List
<
Service
>
searchBrowserServices
(
final
long
startTimestamp
,
final
long
endTimestamp
,
final
String
keyword
)
throws
IOException
{
return
getMetadataQueryDAO
().
searchServices
(
NodeType
.
Browser
,
keyword
)
.
stream
()
.
distinct
()
.
collect
(
Collectors
.
toList
());
}
public
List
<
ServiceInstance
>
getServiceInstances
(
final
long
startTimestamp
,
final
long
endTimestamp
,
...
...
@@ -85,7 +97,11 @@ public class MetadataQueryService implements org.apache.skywalking.oap.server.li
}
public
Service
searchService
(
final
String
serviceCode
)
throws
IOException
{
return
getMetadataQueryDAO
().
searchService
(
serviceCode
);
return
getMetadataQueryDAO
().
searchService
(
NodeType
.
Normal
,
serviceCode
);
}
public
Service
searchBrowserService
(
final
String
serviceCode
)
throws
IOException
{
return
getMetadataQueryDAO
().
searchService
(
NodeType
.
Browser
,
serviceCode
);
}
public
EndpointInfo
getEndpointInfo
(
final
String
endpointId
)
throws
IOException
{
...
...
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/query/IMetadataQueryDAO.java
浏览文件 @
929dc0e9
...
...
@@ -20,6 +20,7 @@ package org.apache.skywalking.oap.server.core.storage.query;
import
java.io.IOException
;
import
java.util.List
;
import
org.apache.skywalking.oap.server.core.analysis.NodeType
;
import
org.apache.skywalking.oap.server.core.query.type.Database
;
import
org.apache.skywalking.oap.server.core.query.type.Endpoint
;
import
org.apache.skywalking.oap.server.core.query.type.Service
;
...
...
@@ -44,16 +45,18 @@ public interface IMetadataQueryDAO extends DAO {
List
<
Database
>
getAllDatabases
()
throws
IOException
;
/**
* @param keyword to filter the normal service
* @param nodeType describe which kind of node of Service
* @param keyword to filter the normal service
* @return the list of normal services matching the given keyword
*/
List
<
Service
>
searchServices
(
final
String
keyword
)
throws
IOException
;
List
<
Service
>
searchServices
(
final
NodeType
nodeType
,
final
String
keyword
)
throws
IOException
;
/**
* @param nodeType describe which kind of node of Service
* @param serviceCode to literal match
* @return the service matching the given full name.
*/
Service
searchService
(
final
String
serviceCode
)
throws
IOException
;
Service
searchService
(
final
NodeType
nodeType
,
final
String
serviceCode
)
throws
IOException
;
/**
* @param keyword to filter the endpoints
...
...
oap-server/server-query-plugin/query-graphql-plugin/src/main/java/org/apache/skywalking/oap/query/graphql/resolver/MetadataQuery.java
浏览文件 @
929dc0e9
...
...
@@ -81,6 +81,16 @@ public class MetadataQuery implements GraphQLQueryResolver {
return
getMetadataQueryService
().
searchService
(
serviceCode
);
}
public
List
<
Service
>
searchBrowserServices
(
final
Duration
duration
,
final
String
keyword
)
throws
IOException
,
ParseException
{
return
getMetadataQueryService
().
searchBrowserServices
(
duration
.
getStartTimestamp
(),
duration
.
getEndTimestamp
(),
keyword
);
}
public
Service
searchBrowserService
(
final
String
serviceCode
)
throws
IOException
{
return
getMetadataQueryService
().
searchBrowserService
(
serviceCode
);
}
public
List
<
ServiceInstance
>
getServiceInstances
(
final
Duration
duration
,
final
String
serviceId
)
throws
IOException
,
ParseException
{
return
getMetadataQueryService
().
getServiceInstances
(
...
...
query-protocol
@
2d1b72ba
比较
47202fc1
...
2d1b72ba
Subproject commit
47202fc1eaa1864c587a78f423a0685ffbe294ad
Subproject commit
2d1b72baab57126e0341e2984e2beb95b39cb385
oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/MetadataQueryEsDAO.java
浏览文件 @
929dc0e9
...
...
@@ -109,13 +109,13 @@ public class MetadataQueryEsDAO extends EsDAO implements IMetadataQueryDAO {
}
@Override
public
List
<
Service
>
searchServices
(
String
keyword
)
throws
IOException
{
public
List
<
Service
>
searchServices
(
final
NodeType
nodeType
,
final
String
keyword
)
throws
IOException
{
final
String
index
=
IndexController
.
LogicIndicesRegister
.
getPhysicalTableName
(
ServiceTraffic
.
INDEX_NAME
);
final
BoolQueryBuilder
query
=
Query
.
bool
()
.
must
(
Query
.
term
(
ServiceTraffic
.
NODE_TYPE
,
NodeType
.
Normal
.
value
()));
.
must
(
Query
.
term
(
ServiceTraffic
.
NODE_TYPE
,
nodeType
.
value
()));
final
SearchBuilder
search
=
Search
.
builder
().
query
(
query
).
size
(
queryMaxSize
);
if
(!
Strings
.
isNullOrEmpty
(
keyword
))
{
...
...
@@ -128,12 +128,12 @@ public class MetadataQueryEsDAO extends EsDAO implements IMetadataQueryDAO {
}
@Override
public
Service
searchService
(
String
serviceCode
)
throws
IOException
{
public
Service
searchService
(
final
NodeType
nodeType
,
final
String
serviceCode
)
throws
IOException
{
final
String
index
=
IndexController
.
LogicIndicesRegister
.
getPhysicalTableName
(
ServiceTraffic
.
INDEX_NAME
);
final
BoolQueryBuilder
query
=
Query
.
bool
()
.
must
(
Query
.
term
(
ServiceTraffic
.
NODE_TYPE
,
NodeType
.
Normal
.
value
()))
.
must
(
Query
.
term
(
ServiceTraffic
.
NODE_TYPE
,
nodeType
.
value
()))
.
must
(
Query
.
term
(
ServiceTraffic
.
NAME
,
serviceCode
));
final
SearchBuilder
search
=
Search
.
builder
().
query
(
query
).
size
(
1
);
...
...
oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/query/MetadataQuery.java
浏览文件 @
929dc0e9
...
...
@@ -110,10 +110,10 @@ public class MetadataQuery implements IMetadataQueryDAO {
}
@Override
public
List
<
Service
>
searchServices
(
String
keyword
)
throws
IOException
{
public
List
<
Service
>
searchServices
(
final
NodeType
nodeType
,
final
String
keyword
)
throws
IOException
{
final
WhereQueryImpl
<
SelectQueryImpl
>
where
=
select
(
ID_COLUMN
,
NAME
,
ServiceTraffic
.
GROUP
)
.
from
(
client
.
getDatabase
(),
ServiceTraffic
.
INDEX_NAME
)
.
where
(
eq
(
TagName
.
NODE_TYPE
,
String
.
valueOf
(
NodeType
.
Normal
.
value
())));
.
where
(
eq
(
TagName
.
NODE_TYPE
,
String
.
valueOf
(
nodeType
.
value
())));
if
(!
Strings
.
isNullOrEmpty
(
keyword
))
{
where
.
and
(
contains
(
NAME
,
keyword
));
}
...
...
@@ -121,10 +121,10 @@ public class MetadataQuery implements IMetadataQueryDAO {
}
@Override
public
Service
searchService
(
String
serviceCode
)
throws
IOException
{
public
Service
searchService
(
final
NodeType
nodeType
,
final
String
serviceCode
)
throws
IOException
{
final
WhereQueryImpl
<
SelectQueryImpl
>
whereQuery
=
select
(
ID_COLUMN
,
NAME
,
ServiceTraffic
.
GROUP
)
.
from
(
client
.
getDatabase
(),
ServiceTraffic
.
INDEX_NAME
)
.
where
(
eq
(
TagName
.
NODE_TYPE
,
String
.
valueOf
(
NodeType
.
Normal
.
value
())));
.
where
(
eq
(
TagName
.
NODE_TYPE
,
String
.
valueOf
(
nodeType
.
value
())));
whereQuery
.
and
(
eq
(
NAME
,
serviceCode
));
return
buildServices
(
whereQuery
).
get
(
0
);
}
...
...
oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/h2/dao/H2MetadataQueryDAO.java
浏览文件 @
929dc0e9
...
...
@@ -123,12 +123,12 @@ public class H2MetadataQueryDAO implements IMetadataQueryDAO {
}
@Override
public
List
<
Service
>
searchServices
(
String
keyword
)
throws
IOException
{
public
List
<
Service
>
searchServices
(
final
NodeType
nodeType
,
final
String
keyword
)
throws
IOException
{
StringBuilder
sql
=
new
StringBuilder
();
List
<
Object
>
condition
=
new
ArrayList
<>(
5
);
sql
.
append
(
"select * from "
).
append
(
ServiceTraffic
.
INDEX_NAME
).
append
(
" where "
);
sql
.
append
(
ServiceTraffic
.
NODE_TYPE
).
append
(
"=?"
);
condition
.
add
(
NodeType
.
Normal
.
value
());
condition
.
add
(
nodeType
.
value
());
if
(!
Strings
.
isNullOrEmpty
(
keyword
))
{
sql
.
append
(
" and "
).
append
(
ServiceTraffic
.
NAME
).
append
(
" like concat('%',?,'%')"
);
condition
.
add
(
keyword
);
...
...
@@ -146,12 +146,12 @@ public class H2MetadataQueryDAO implements IMetadataQueryDAO {
}
@Override
public
Service
searchService
(
String
serviceCode
)
throws
IOException
{
public
Service
searchService
(
NodeType
nodeType
,
String
serviceCode
)
throws
IOException
{
StringBuilder
sql
=
new
StringBuilder
();
List
<
Object
>
condition
=
new
ArrayList
<>(
5
);
sql
.
append
(
"select * from "
).
append
(
ServiceTraffic
.
INDEX_NAME
).
append
(
" where "
);
sql
.
append
(
ServiceTraffic
.
NODE_TYPE
).
append
(
"=?"
);
condition
.
add
(
NodeType
.
Normal
.
value
());
condition
.
add
(
nodeType
.
value
());
sql
.
append
(
" and "
).
append
(
ServiceTraffic
.
NAME
).
append
(
" = ?"
);
condition
.
add
(
serviceCode
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录