You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2020/04/16 02:10:05 UTC

[skywalking-query-protocol] branch metrics updated: Update

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

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


The following commit(s) were added to refs/heads/metrics by this push:
     new 776c329  Update
776c329 is described below

commit 776c329d14b2497c4d308f0e744caaabda3dbd4f
Author: Wu Sheng <wu...@foxmail.com>
AuthorDate: Thu Apr 16 10:09:22 2020 +0800

    Update
---
 common.graphqls     | 22 ----------------------
 metrics-v2.graphqls | 53 +++++++++++++++++++++++++++++++++++++++++++++++++----
 2 files changed, 49 insertions(+), 26 deletions(-)

diff --git a/common.graphqls b/common.graphqls
index a08a240..2897449 100644
--- a/common.graphqls
+++ b/common.graphqls
@@ -52,28 +52,6 @@ input Duration {
     step: Step!
 }
 
-input Entity {
-    # 1. scope=All, no name is required.
-    # 2. scope=Service, ServiceInstance and Endpoint, set neccessary serviceName/serviceInstanceName/endpointName
-    # 3. Scope=ServiceRelation, ServiceInstanceRelation and EndpointRelation
-    #    serviceName/serviceInstanceName/endpointName is/are the source(s)
-    #    destServiceName/destServiceInstanceName/destEndpointName is/are destination(s)
-    #    set necessary names of sources and destinations.
-    scope: Scope!
-    serviceName: String
-    # Normal service is the service having installed agent or metrics reported directly.
-    # Unnormal service is conjectural service, usually detected by the agent.
-    isNormal: Boolean
-    serviceInstanceName: String
-    endpointName: String
-    destServiceName: String
-    # Normal service is the service having installed agent or metrics reported directly.
-    # Unnormal service is conjectural service, usually detected by the agent.
-    destIsNormal: Boolean
-    destServiceInstanceName: String
-    destEndpointName: String
-}
-
 enum Step {
     DAY
     HOUR
diff --git a/metrics-v2.graphqls b/metrics-v2.graphqls
index ebefd2a..86444c6 100644
--- a/metrics-v2.graphqls
+++ b/metrics-v2.graphqls
@@ -14,9 +14,32 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Metrics v2 query protocol is an alternative metrics query(s) of original v1, defined in the metric.graphql and aggregation.graphqls.
+# Metrics v2 query protocol is an alternative metrics query(s) of original v1,
+# defined in the metric.graphql, top-n-records.graphqls, and aggregation.graphqls.
 # By leveraging the new ID rule(no register) in the v8, we could query metrics based on name(s) directly.
 
+input Entity {
+    # 1. scope=All, no name is required.
+    # 2. scope=Service, ServiceInstance and Endpoint, set neccessary serviceName/serviceInstanceName/endpointName
+    # 3. Scope=ServiceRelation, ServiceInstanceRelation and EndpointRelation
+    #    serviceName/serviceInstanceName/endpointName is/are the source(s)
+    #    destServiceName/destServiceInstanceName/destEndpointName is/are destination(s)
+    #    set necessary names of sources and destinations.
+    scope: Scope!
+    serviceName: String
+    # Normal service is the service having installed agent or metrics reported directly.
+    # Unnormal service is conjectural service, usually detected by the agent.
+    isNormal: Boolean
+    serviceInstanceName: String
+    endpointName: String
+    destServiceName: String
+    # Normal service is the service having installed agent or metrics reported directly.
+    # Unnormal service is conjectural service, usually detected by the agent.
+    destIsNormal: Boolean
+    destServiceInstanceName: String
+    destEndpointName: String
+}
+
 input MetricsCondition {
     # Metrics name, which should be defined in OAL script
     # Such as:
@@ -46,6 +69,17 @@ input TopNCondition {
     order: Order!
 }
 
+type MetricsDefintion {
+    valueType: MetricsType
+}
+
+# Metrics type is a new concept since v8.
+enum MetricsType {
+    # Regular value type is suitable for getValuesByEntity, getLinearIntValuesByEntity
+    REGULAR_VALUE
+    HEATMAP
+}
+
 type HeatMap {
     # Each element in nodes represents a point in Thermodynamic Diagram
     # And the element includes three values:
@@ -62,12 +96,20 @@ type HeatMap {
     axisYStep: Int!
 }
 
-type TopN {
+type TopNMetrics {
     name: String!
     id: ID!
     value: Long!
 }
 
+type TopNStatement {
+    statement: String
+    latency: Long!
+    # Have value, Only if the record has the trace id.
+    # Slow record
+    traceId: String
+}
+
 extend type Query {
     getValuesByEntity(metrics: BatchMetricsConditions!, duration: Duration!): IntValues
     getLinearIntValuesByEntity(metrics: MetricsCondition!, duration: Duration!): IntValues
@@ -77,7 +119,10 @@ extend type Query {
     # then five lines will be responsed, p50 is the first element of return value.
     getMultipleLinearIntValuesByEntity(metrics: MetricsCondition!, linearIndex: [Int!]!, duration: Duration!): [IntValues!]!
     getHeatmapByEntity(metrics: MetricsCondition!, duration: Duration!): HeatMap
-    # Get TopN from the given entity and parameters.
+    # Get TopN metrics values from the given entity and parameters.
     # The alternative query of get* in aggregation.graphqls
-    getTopN(metrics: TopNCondition!, order: Order!): [TopN!]!
+    getTopN(metrics: TopNCondition!, order: Order!): [TopNMetrics!]!
+    # Get TopN statements from the given entity and parameters.
+    # The alternative query of get* in top-n-records.graphqls
+    getTopNStatements(metrics: TopNCondition!, order: Order!): [TopNStatement!]!
 }
\ No newline at end of file