You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@skywalking.apache.org by wu...@apache.org on 2018/07/30 07:08:54 UTC

[incubator-skywalking] branch 6.0 updated (efe5299 -> 1a197c2)

This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a change to branch 6.0
in repository https://gitbox.apache.org/repos/asf/incubator-skywalking.git.


    from efe5299  Feature/oap/remote (#1505)
     new cb69e96  Refactor the graphQL query protocol. @hanahmily @peng-yongsheng
     new ccfef16  Merge branch '6.0' of https://github.com/apache/incubator-skywalking into 6.0
     new 1a197c2  Finish GraphQL protocol document.

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../aggregation.graphqls}                          | 55 +++++++++-------------
 .../main/resources/ui-graphql-v6/alarm.graphqls    | 24 +++++++---
 .../main/resources/ui-graphql-v6/common.graphqls   |  9 ++++
 .../src/main/resources/ui-graphql-v6/jvm.graphqls  | 41 ----------------
 .../{overview.graphqls => metadata.graphqls}       |  8 +---
 .../main/resources/ui-graphql-v6/metric.graphqls   | 13 -----
 .../apm/ui/protocol/GraphQLv6ScriptTest.java       |  5 +-
 docs/en/protocols/README.md                        | 23 +++++++--
 8 files changed, 73 insertions(+), 105 deletions(-)
 copy apm-protocol/apm-ui-protocol/src/main/resources/{ui-graphql/config.graphqls => ui-graphql-v6/aggregation.graphqls} (50%)
 copy apm-dist/bin/startup.sh => apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql-v6/alarm.graphqls (68%)
 delete mode 100644 apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql-v6/jvm.graphqls
 rename apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql-v6/{overview.graphqls => metadata.graphqls} (86%)


[incubator-skywalking] 01/03: Refactor the graphQL query protocol. @hanahmily @peng-yongsheng

Posted by wu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch 6.0
in repository https://gitbox.apache.org/repos/asf/incubator-skywalking.git

commit cb69e968f1f04bff3ea7cceb666c9bb0aeabc137
Author: Wu Sheng <wu...@foxmail.com>
AuthorDate: Mon Jul 30 12:08:41 2018 +0800

    Refactor the graphQL query protocol. @hanahmily @peng-yongsheng
---
 .../resources/ui-graphql-v6/aggregation.graphqls   | 45 ++++++++++++++++++++++
 .../ui-graphql-v6/{jvm.graphqls => alarm.graphqls} | 29 ++++++--------
 .../main/resources/ui-graphql-v6/common.graphqls   |  9 +++++
 .../{overview.graphqls => metadata.graphqls}       |  8 +---
 .../main/resources/ui-graphql-v6/metric.graphqls   | 13 -------
 .../apm/ui/protocol/GraphQLv6ScriptTest.java       |  5 ++-
 6 files changed, 70 insertions(+), 39 deletions(-)

diff --git a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql-v6/aggregation.graphqls b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql-v6/aggregation.graphqls
new file mode 100644
index 0000000..4e7d221
--- /dev/null
+++ b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql-v6/aggregation.graphqls
@@ -0,0 +1,45 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Match the metric by name, order by metric value(such as: avg, percent)
+input TopNCondition {
+    name: String!
+    topN: Int!
+    order: Order!
+    # When the scope is ServiceInstance or Endpoint,
+    # most likely you need a secondary filter.
+    # Such as:
+    # 1. Get topN service instance in a given service id
+    # 2. Get topN endpoint in a given serivce id.
+    # Backend will decide the filter id meaning by Scope.
+    #
+    # Defintely, it is not required by default.
+    filterScope: Scope
+    filterId: Int
+}
+
+type TopNEntity {
+    name: String!
+    id: ID!
+    value: Int!
+}
+
+# The aggregation query is different with the metric query.
+# All aggregation queries require backend or/and storage do aggregation in query time.
+extend type Query {
+    # TopN is an aggregation query.
+    getTopN(metric: TopNCondition!): [TopNEntity!]!
+}
\ No newline at end of file
diff --git a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql-v6/jvm.graphqls b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql-v6/alarm.graphqls
similarity index 57%
rename from apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql-v6/jvm.graphqls
rename to apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql-v6/alarm.graphqls
index eb098d4..52d7d22 100644
--- a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql-v6/jvm.graphqls
+++ b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql-v6/alarm.graphqls
@@ -14,28 +14,23 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-type CPUTrend {
-    cost: [Int!]!
+#  the trend alarm trigger times
+type AlarmTrend {
+    numOfAlarm: [Int]!
 }
 
-# The gc trend represents the numbers and time of Garbage Collector execution
-type GCTrend {
-    youngGCCount: [Int!]!
-    oldGCount: [Int!]!
-    youngGCTime: [Int!]!
-    oldGCTime: [Int!]!
+type AlarmMessage {
+    scope: Scope!
+    id: ID!
+    message: String!
 }
 
-# The memory used and max limit in heap and noheap space.
-type MemoryTrend {
-    heap: [Int!]!
-    maxHeap: [Int!]!
-    noheap: [Int!]!
-    maxNoheap: [Int!]!
+type Alarms {
+    msgs: [AlarmMessage!]!
+    total: Int!
 }
 
 extend type Query {
-    getJVMCPUTrend(serviceInstanceId: ID!, duration: Duration!): CPUTrend
-    getJVMGCTrend(serviceInstanceId: ID!, duration: Duration!): GCTrend
-    getJVMMemoryTrend(serviceInstanceId: ID!, duration: Duration!): MemoryTrend
+    getAlarmTrend(duration: Duration!): AlarmTrend!
+    getAlarm(duration: Duration!, scope: Scope, paging: Pagination!): Alarms
 }
\ No newline at end of file
diff --git a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql-v6/common.graphqls b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql-v6/common.graphqls
index b0a8785..258e2b4 100644
--- a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql-v6/common.graphqls
+++ b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql-v6/common.graphqls
@@ -82,3 +82,12 @@ enum Language {
     PYTHON
     RUBY
 }
+
+enum Scope {
+    SERVICE
+    SERVICE_INSTANCE
+    ENDPOINT
+    SERVICE_RELATION
+    SERVICE_INSTANCE_RELATION
+    ENDPOINT_RELATION
+}
\ No newline at end of file
diff --git a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql-v6/overview.graphqls b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql-v6/metadata.graphqls
similarity index 86%
rename from apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql-v6/overview.graphqls
rename to apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql-v6/metadata.graphqls
index 42ad5de..2c1bc07 100644
--- a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql-v6/overview.graphqls
+++ b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql-v6/metadata.graphqls
@@ -23,11 +23,6 @@ type ClusterBrief {
     numOfMQ: Int!
 }
 
-# Query the trend of alarm rate based on the given duration
-type AlarmTrend {
-    numOfAlarmRate: [Int]!
-}
-
 type Service {
     id: ID!
     name: String!
@@ -52,7 +47,6 @@ type Endpoint {
 
 extend type Query {
     getGlobalBrief(duration: Duration!): ClusterBrief
-    getAlarmTrend(duration: Duration!): AlarmTrend
 
     # Service related meta info.
     getAllServices(duration: Duration!): [Service!]!
@@ -64,5 +58,5 @@ extend type Query {
     # Endpoint query
     # Consider there are huge numbers of endpoint,
     # must use endpoint owner's service id, keyword and top N filter to do query.
-    searchEndpoint(keyword: String!, serviceId: ID!, topNFilter: MetricTopNCondition!): [Endpoint!]!
+    searchEndpoint(keyword: String!, serviceId: ID!, topN: Int!): [Endpoint!]!
 }
\ No newline at end of file
diff --git a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql-v6/metric.graphqls b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql-v6/metric.graphqls
index f63cc15..9f27d71 100644
--- a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql-v6/metric.graphqls
+++ b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql-v6/metric.graphqls
@@ -54,21 +54,8 @@ type Thermodynamic {
     axisYStep: Int!
 }
 
-# Match the metric by name, order by metric value(such as: avg, percent)
-input MetricTopNCondition {
-    name: String!
-    topN: Int!
-    order: Order!
-}
-
-type MetricEntity {
-    name: String!
-    id: ID!
-    value: Int!
-}
 
 extend type Query {
     getLinearIntValues(metric: MetricCondition!, duration: Duration!): LinearIntValues
     getThermodynamic(metric: MetricCondition!, duration: Duration!): Thermodynamic
-    getTopN(metric: MetricTopNCondition!): [MetricEntity!]!
 }
\ No newline at end of file
diff --git a/apm-protocol/apm-ui-protocol/src/test/java/org/apache/skywalking/apm/ui/protocol/GraphQLv6ScriptTest.java b/apm-protocol/apm-ui-protocol/src/test/java/org/apache/skywalking/apm/ui/protocol/GraphQLv6ScriptTest.java
index 71cead4..f3d7adf 100644
--- a/apm-protocol/apm-ui-protocol/src/test/java/org/apache/skywalking/apm/ui/protocol/GraphQLv6ScriptTest.java
+++ b/apm-protocol/apm-ui-protocol/src/test/java/org/apache/skywalking/apm/ui/protocol/GraphQLv6ScriptTest.java
@@ -38,9 +38,10 @@ public class GraphQLv6ScriptTest {
         typeRegistry.merge(schemaParser.parse(loadSchema("common.graphqls")));
         typeRegistry.merge(schemaParser.parse(loadSchema("trace.graphqls")));
         typeRegistry.merge(schemaParser.parse(loadSchema("metric.graphqls")));
-        typeRegistry.merge(schemaParser.parse(loadSchema("overview.graphqls")));
+        typeRegistry.merge(schemaParser.parse(loadSchema("metadata.graphqls")));
         typeRegistry.merge(schemaParser.parse(loadSchema("topology.graphqls")));
-        typeRegistry.merge(schemaParser.parse(loadSchema("jvm.graphqls")));
+        typeRegistry.merge(schemaParser.parse(loadSchema("alarm.graphqls")));
+        typeRegistry.merge(schemaParser.parse(loadSchema("aggregation.graphqls")));
         RuntimeWiring wiring = buildRuntimeWiring();
         assertTrue(schemaGenerator.makeExecutableSchema(typeRegistry, wiring).getAllTypesAsList().size() > 0);
     }


[incubator-skywalking] 02/03: Merge branch '6.0' of https://github.com/apache/incubator-skywalking into 6.0

Posted by wu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch 6.0
in repository https://gitbox.apache.org/repos/asf/incubator-skywalking.git

commit ccfef16cda0241adb42d6fb026dfb64525683b5b
Merge: cb69e96 efe5299
Author: Wu Sheng <wu...@foxmail.com>
AuthorDate: Mon Jul 30 15:08:24 2018 +0800

    Merge branch '6.0' of https://github.com/apache/incubator-skywalking into 6.0

 .../plugin/standalone/StandaloneManagerTest.java   |   7 +-
 .../ClusterModuleZookeeperProviderTestCase.java    |  17 +--
 oap-server/server-core/pom.xml                     |  50 +++++++
 .../skywalking/oap/server/core/CoreModule.java     |  12 ++
 .../oap/server/core/CoreModuleProvider.java        |  51 ++++---
 .../server/core/analysis/DispatcherManager.java    |   5 +-
 .../oap/server/core/analysis/data/StreamData.java  |   4 +-
 .../core/analysis/endpoint/EndpointDispatcher.java |  19 ++-
 ...java => EndpointLatencyAvgAggregateWorker.java} |  16 ++-
 .../endpoint/EndpointLatencyAvgIndicator.java      |  27 +++-
 ...ava => EndpointLatencyAvgPersistentWorker.java} |  12 +-
 ...or.java => EndpointLatencyAvgRemoteWorker.java} |  17 ++-
 .../core/analysis/indicator/AvgIndicator.java      |  16 +--
 .../server/core/analysis/indicator/Indicator.java  |   8 +-
 .../indicator/annotation/IndicatorType.java        |   2 +
 .../IndicatorDefineLoadException.java}             |  12 +-
 .../analysis/indicator/define/IndicatorMapper.java |  82 +++++++++++
 .../AbstractAggregatorWorker.java}                 |  19 +--
 .../AbstractPersistentWorker.java}                 |  16 +--
 .../core/analysis/worker/AbstractRemoteWorker.java |  63 ++++++++
 .../IndicatorType.java => worker/Worker.java}      |  10 +-
 .../define/WorkerDefineLoadException.java}         |  12 +-
 .../core/analysis/worker/define/WorkerMapper.java  | 102 +++++++++++++
 .../oap/server/core/cluster/RemoteInstance.java    |  41 ++----
 .../server/core/receiver/SourceReceiverImpl.java   |   5 +-
 .../remote/{Selector.java => Deserializable.java}  |   6 +-
 .../server/core/remote/RemoteSenderService.java    |  60 ++++++++
 .../server/core/remote/RemoteServiceHandler.java   |  71 +++++++++
 .../RemoteData.java => remote/Serializable.java}   |   8 +-
 .../core/remote/client/GRPCRemoteClient.java       | 158 +++++++++++++++++++++
 .../client/RemoteClient.java}                      |  14 +-
 .../core/remote/client/RemoteClientManager.java    | 126 ++++++++++++++++
 .../core/remote/client/SelfRemoteClient.java}      |  34 +++--
 .../selector/ForeverFirstSelector.java}            |  17 ++-
 .../selector/HashCodeSelector.java}                |  17 +--
 .../selector/RemoteClientSelector.java}            |  11 +-
 .../selector/RollingSelector.java}                 |  32 ++---
 .../core/remote/{ => selector}/Selector.java       |   2 +-
 .../Indicator.java => proto/RemoteService.proto}   |  33 +++--
 .../main/resources/META-INF/defines/indicator.def  |  19 +++
 .../src/main/resources/META-INF/defines/worker.def |  21 +++
 .../indicator/define/IndicatorMapperTestCase.java} |  18 +--
 .../indicator/define/TestAvgIndicator.java}        |  18 +--
 .../test/resources/META-INF/defines/indicator.def  |  19 +++
 .../src/test/resources/META-INF/defines/worker.def |  17 +++
 .../server-core/src/test/resources/log4j2.xml      |  31 ++++
 .../oap/server/library/client/grpc/GRPCClient.java |   5 +-
 .../oap/server/library/module/ModuleProvider.java  |   3 +-
 .../receiver/mesh/provider/MeshGRPCHandler.java    |   2 -
 49 files changed, 1117 insertions(+), 250 deletions(-)


[incubator-skywalking] 03/03: Finish GraphQL protocol document.

Posted by wu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch 6.0
in repository https://gitbox.apache.org/repos/asf/incubator-skywalking.git

commit 1a197c22212377790758a32d733c4d53d8537f8e
Author: Wu Sheng <wu...@foxmail.com>
AuthorDate: Mon Jul 30 15:08:49 2018 +0800

    Finish GraphQL protocol document.
---
 docs/en/protocols/README.md | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/docs/en/protocols/README.md b/docs/en/protocols/README.md
index 3677d39..69413b0 100644
--- a/docs/en/protocols/README.md
+++ b/docs/en/protocols/README.md
@@ -1,9 +1,9 @@
 # Protocols
 There are two types of protocols list here. 
 
-- **Probe Protocol**. Include the descriptions and definitions about how agent send collected metric data and traces, also the formats of each entities.
+- [**Probe Protocol**](#probe-protocols). Include the descriptions and definitions about how agent send collected metric data and traces, also the formats of each entities.
 
-- **Query Protocol**. The backend provide query capability to SkyWalking own UI and others. These queries are based on GraphQL.
+- [**Query Protocol**](#query-protocol). The backend provide query capability to SkyWalking own UI and others. These queries are based on GraphQL.
 
 ## Probe Protocols
 They also related to the probe group, for understand that, look [Concepts and Designs](../concepts-and-designs/README.md) document.
@@ -35,4 +35,21 @@ the following key info:
 3rd-party instrument protocols are not defined by SkyWalking. They are just protocols/formats, which SkyWalking is compatible and
 could receive from their existed libraries. SkyWalking starts with supporting Zipkin v1, v2 data formats.
 
-Backend is based on modulization principle, so very easy to extend a new receiver to support new protocol/format.
\ No newline at end of file
+Backend is based on modulization principle, so very easy to extend a new receiver to support new protocol/format.
+
+## Query Protocol
+Query protocol follows GraphQL grammar, provides data query capabilities, which depends on your analysis metrics.
+
+There are 5 dimensionality data is provided.
+1. Metadata. Metadata includes the brief info of the whole under monitoring services and their instances, endpoints, etc.
+Use multiple ways to query this meta data.
+1. Metric. Metric query targets all the objects defined in [OAL script](../concepts-and-designs/oal.md). You could get the 
+metric data in linear or thermodynamic matrix formats based on the aggregation functions in script. 
+1. Aggregation. Aggregation query means the metric data need a secondary aggregation in query stage, which makes the query 
+interfaces have some different arguments. Such as, `TopN` list of services is a very typical aggregation query, 
+metric stream aggregation just calculates the metric values of each service, but the expected list needs ordering metric data
+by the values.
+1. Trace. Query distributed traces by this.
+1. Alarm. Through alarm query, you can have alarm trend and details.
+
+The actual query GraphQL scrips could be found in [here](../../../apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql-v6).  
\ No newline at end of file