From d730e174f625b49cac3873b7d87d1c318b4503c1 Mon Sep 17 00:00:00 2001 From: wu-sheng Date: Tue, 9 Jan 2018 12:11:56 +0800 Subject: [PATCH 01/10] Make the nodes of Topology nullable. And elements in it are not null. --- .../src/main/resources/ui-graphql/common.graphqls | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/common.graphqls b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/common.graphqls index 853f36258..ef552f7e8 100644 --- a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/common.graphqls +++ b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/common.graphqls @@ -56,8 +56,8 @@ type SLATrend { # The overview topology of the whole application cluster or services, type Topology { - nodes: [Node]! - calls: [Call] + nodes: [Node!] + calls: [Call!] } # The base Node of all node types in topology From 06b9f5f692a991f69619262e34bbb1e2a0494a73 Mon Sep 17 00:00:00 2001 From: wu-sheng Date: Wed, 10 Jan 2018 16:38:22 +0800 Subject: [PATCH 02/10] 1. Add set/get `DataTTLConfigs` and set/get `AlarmThreshold` mutation service. 2. All empty arrays are represented by `[]`, not `null`. 3. Add Mutation type, represents for all modification operations. 4. Support **Pagination** in some query. 5. Seperate alarm into to title and content --- .../main/resources/ui-graphql/alarm.graphqls | 8 ++++++- .../ui-graphql/application-layer.graphqls | 4 ++-- .../main/resources/ui-graphql/common.graphqls | 21 +++++++++++++++---- .../main/resources/ui-graphql/config.graphqls | 12 +++++++++++ .../ui-graphql/server-layer.graphqls | 14 ++++++------- .../main/resources/ui-graphql/trace.graphqls | 12 +++++------ 6 files changed, 51 insertions(+), 20 deletions(-) create mode 100644 apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/config.graphqls diff --git a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/alarm.graphqls b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/alarm.graphqls index b63946d8b..8ecd0fb3c 100644 --- a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/alarm.graphqls +++ b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/alarm.graphqls @@ -2,6 +2,7 @@ type AlarmItem { content: String! startTime: String! alertType: AlarmType! + causeType: CauseType! } enum AlarmType { @@ -10,6 +11,11 @@ enum AlarmType { SERVICE } +enum CauseType { + LOW_SUCCESS_RATE, + SLOW_RESPONSE +} + extend type Query { - loadAlertList(keyword: String, alertType: AlarmType, duration:Duration!):[AlarmItem] + loadAlertList(keyword: String, alertType: AlarmType, duration:Duration!, paging: Pagination!):[AlarmItem!]! } \ No newline at end of file diff --git a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/application-layer.graphqls b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/application-layer.graphqls index f8ccf0eb9..fa11d753f 100644 --- a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/application-layer.graphqls +++ b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/application-layer.graphqls @@ -35,6 +35,6 @@ type ConjecturalNode implements Node { extend type Query { getAllApplication(duration: Duration!): [ApplicationNode] getApplicationTopology(applicationId: ID!, duration: Duration!): Topology - getSlowService(applicationId: ID!, duration: Duration!): [ServiceInfo!] - getServerThroughput(applicationId: ID!, duration: Duration!): [AppServerInfo!] + getSlowService(applicationId: ID!, duration: Duration, top: Int!!): [ServiceInfo!] + getServerThroughput(applicationId: ID!, duration: Duration!, top: Int!): [AppServerInfo!] } diff --git a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/common.graphqls b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/common.graphqls index ef552f7e8..c074e5254 100644 --- a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/common.graphqls +++ b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/common.graphqls @@ -1,5 +1,6 @@ schema { query: Query + mutation: Mutation } #Root node @@ -7,6 +8,10 @@ type Query { version: String } +type Mutation { + version: String +} + # The Duration defines the start and end time for each query operation. # Fields: `start` and `end` # represents the time span. And each of them matches the step. @@ -39,6 +44,14 @@ enum Step { SECOND } +type Pagination { + //pageNum starts in 1, the default is 1. + pageNum: Int + pageSize: Int! + //default false + needTotal: Boolean +} + ###################################### # Common Metrics and Trends ###################################### @@ -47,17 +60,17 @@ type ResponseTimeTrend { } type ThroughputTrend { - trendList: [Int!] + trendList: [Int!]! } type SLATrend { - trendList: [Int!] + trendList: [Int!]! } # The overview topology of the whole application cluster or services, type Topology { - nodes: [Node!] - calls: [Call!] + nodes: [Node!]! + calls: [Call!]! } # The base Node of all node types in topology diff --git a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/config.graphqls b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/config.graphqls new file mode 100644 index 000000000..e4df497e4 --- /dev/null +++ b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/config.graphqls @@ -0,0 +1,12 @@ +type TTLConfigs { + items: [TTLConfigItem]! +} + +type TTLConfigItem { + unit: Step! + value: Int! +} + +extend type Mutation { + setDataTTLConfigs(ttl: TTLConfigs!): TTLConfigs +} \ No newline at end of file diff --git a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/server-layer.graphqls b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/server-layer.graphqls index eac33a7dc..1d01ec211 100644 --- a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/server-layer.graphqls +++ b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/server-layer.graphqls @@ -15,21 +15,21 @@ type AppServerInfo { } type CPUTrend { - cost: [Int!] + cost: [Int!]! } # The gc trend represents the numbers of Garbage Collector execution type GCTrend { - youngGC: [Int!] - oldGC: [Int!] + youngGC: [Int!]! + oldGC: [Int!]! } # The memory used and max limit in heap and noheap space. type MemoryTrend { - heap: [Int!] - maxHeap: [Int!] - noheap: [Int!] - maxNoheap: [Int!] + heap: [Int!]! + maxHeap: [Int!]! + noheap: [Int!]! + maxNoheap: [Int!]! } extend type Query { diff --git a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/trace.graphqls b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/trace.graphqls index 4e2e1a0ec..efdbe9645 100644 --- a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/trace.graphqls +++ b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/trace.graphqls @@ -1,6 +1,7 @@ # The list of traces type TraceBrief { - traces: [BasicTrace!] + traces: [BasicTrace!]! + total: Int! } # Trace basic info @@ -23,8 +24,7 @@ input TraceQueryCondition { minTraceDuration: Int # The max time of trace maxTraceDuration: Int - topN: Boolean - needTotal: Int + paging: Pagination! } enum QueryOrder { @@ -46,7 +46,7 @@ type Segment { } type Span { - refs: [Ref!] + refs: [Ref!]! spanId: Int! parentSpanId: Int! startTime: Long! @@ -60,8 +60,8 @@ type Span { isError: Boolean # There are 5 layers: Unknown, Database, RPCFramework, Http, MQ and Cache layer: String - tags: [KeyValue!] - logs: [LogEntity!] + tags: [KeyValue!]! + logs: [LogEntity!]! } # Ref represents the link between the segment and its parents. From e7a5fd692023fe3ac2875f3d8bacaaf60aef7a0c Mon Sep 17 00:00:00 2001 From: wu-sheng Date: Wed, 10 Jan 2018 16:39:40 +0800 Subject: [PATCH 03/10] no message --- .../main/resources/ui-graphql/alarm.graphqls | 4 ++ .../ui-graphql/application-layer.graphqls | 2 +- .../main/resources/ui-graphql/common.graphqls | 6 +-- .../main/resources/ui-graphql/config.graphqls | 38 ++++++++++++++++--- .../ui-graphql/overview-layer.graphqls | 6 +-- .../main/resources/ui-graphql/trace.graphqls | 2 +- .../apm/ui/protocol/GraphQLScriptTest.java | 1 + 7 files changed, 45 insertions(+), 14 deletions(-) diff --git a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/alarm.graphqls b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/alarm.graphqls index 8ecd0fb3c..9cb54a7de 100644 --- a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/alarm.graphqls +++ b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/alarm.graphqls @@ -1,4 +1,8 @@ type AlarmItem { + # Typical include: Application Code + cause type. This is a short description. + title: String! + # Include all related info to trigger this alarm. + # such as: threshold, trigger value, relation(greater or lower), last time content: String! startTime: String! alertType: AlarmType! diff --git a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/application-layer.graphqls b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/application-layer.graphqls index fa11d753f..d05aeee16 100644 --- a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/application-layer.graphqls +++ b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/application-layer.graphqls @@ -35,6 +35,6 @@ type ConjecturalNode implements Node { extend type Query { getAllApplication(duration: Duration!): [ApplicationNode] getApplicationTopology(applicationId: ID!, duration: Duration!): Topology - getSlowService(applicationId: ID!, duration: Duration, top: Int!!): [ServiceInfo!] + getSlowService(applicationId: ID!, duration: Duration, top: Int!): [ServiceInfo!] getServerThroughput(applicationId: ID!, duration: Duration!, top: Int!): [AppServerInfo!] } diff --git a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/common.graphqls b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/common.graphqls index c074e5254..e4d7e10ca 100644 --- a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/common.graphqls +++ b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/common.graphqls @@ -44,11 +44,11 @@ enum Step { SECOND } -type Pagination { - //pageNum starts in 1, the default is 1. +input Pagination { + # pageNum starts in 1, the default is 1. pageNum: Int pageSize: Int! - //default false + # default false needTotal: Boolean } diff --git a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/config.graphqls b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/config.graphqls index e4df497e4..aaa102e1c 100644 --- a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/config.graphqls +++ b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/config.graphqls @@ -1,12 +1,38 @@ -type TTLConfigs { - items: [TTLConfigItem]! -} - -type TTLConfigItem { +input TTLConfigItem { unit: Step! value: Int! } +type ExistedTTLConfigs{ + ttl: [TTL!]! +} + +type TTL { + unit: Step! + value: Int! +} + +input AlarmThreshold { + type: AlarmType! + threshold: Int! + causeType: CauseType! +} + +type ExistedAlarmThresholds { + items: [ExistedAlarmThresholdItem!]! +} + +type ExistedAlarmThresholdItem { + threshold: Int! + causeType: CauseType! +} + extend type Mutation { - setDataTTLConfigs(ttl: TTLConfigs!): TTLConfigs + setDataTTLConfigs(ttl: [TTLConfigItem!]!): Boolean! + setAlarmThreshold(thresholds: [AlarmThreshold!]!): Boolean! +} + +extend type Query { + queryAllDataTTLConfigs: ExistedTTLConfigs! + queryAlarmThresholds(alarmType: AlarmType): ExistedAlarmThresholds! } \ No newline at end of file diff --git a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/overview-layer.graphqls b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/overview-layer.graphqls index e7b0bc2d6..04b1033a6 100644 --- a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/overview-layer.graphqls +++ b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/overview-layer.graphqls @@ -15,7 +15,7 @@ type AlarmTrend { # Query all conjectural applications based on the given duration # All applications here are not installed agent. type ConjecturalAppBrief { - apps: [ConjecturalApp!] + apps: [ConjecturalApp!]! } # The basic info of the conjectural application, @@ -32,6 +32,6 @@ extend type Query { getClusterBrief(duration: Duration!): ClusterBrief getAlarmTrend(duration: Duration!): AlarmTrend getConjecturalApps(duration: Duration!): ConjecturalAppBrief - getTopNSlowService(duration: Duration!, topN: Int!): [ServiceInfo!] - getTopNServerThroughput(duration: Duration!, topN: Int!): [AppServerInfo!] + getTopNSlowService(duration: Duration!, topN: Int!): [ServiceInfo!]! + getTopNServerThroughput(duration: Duration!, topN: Int!): [AppServerInfo!]! } diff --git a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/trace.graphqls b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/trace.graphqls index efdbe9645..b52ea0fe4 100644 --- a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/trace.graphqls +++ b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/trace.graphqls @@ -35,7 +35,7 @@ enum QueryOrder { # The trace represents a distributed trace, includes all segments and spans. type Trace { traceId: ID! - segments: [Segment!] + segments: [Segment!]! } type Segment { diff --git a/apm-protocol/apm-ui-protocol/src/test/java/org/apache/skywalking/apm/ui/protocol/GraphQLScriptTest.java b/apm-protocol/apm-ui-protocol/src/test/java/org/apache/skywalking/apm/ui/protocol/GraphQLScriptTest.java index f017d6844..5c93a8e93 100644 --- a/apm-protocol/apm-ui-protocol/src/test/java/org/apache/skywalking/apm/ui/protocol/GraphQLScriptTest.java +++ b/apm-protocol/apm-ui-protocol/src/test/java/org/apache/skywalking/apm/ui/protocol/GraphQLScriptTest.java @@ -43,6 +43,7 @@ public class GraphQLScriptTest { typeRegistry.merge(schemaParser.parse(loadSchema("server-layer.graphqls"))); typeRegistry.merge(schemaParser.parse(loadSchema("service-layer.graphqls"))); typeRegistry.merge(schemaParser.parse(loadSchema("alarm.graphqls"))); + typeRegistry.merge(schemaParser.parse(loadSchema("config.graphqls"))); RuntimeWiring wiring = buildRuntimeWiring(); assertTrue(schemaGenerator.makeExecutableSchema(typeRegistry, wiring).getAllTypesAsList().size() > 0); } From b2706cf24cf770564e93d00603c850ef277f3e1a Mon Sep 17 00:00:00 2001 From: wusheng Date: Thu, 11 Jan 2018 16:13:19 +0800 Subject: [PATCH 04/10] Make the user node as an extend of Node, rather then an attribute of ApplicationNode. --- .../main/resources/ui-graphql/application-layer.graphqls | 7 +++---- .../src/main/resources/ui-graphql/common.graphqls | 6 ++++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/application-layer.graphqls b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/application-layer.graphqls index d05aeee16..e7f72bfef 100644 --- a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/application-layer.graphqls +++ b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/application-layer.graphqls @@ -8,7 +8,9 @@ type ApplicationNode implements Node { # 2 Digits after floating point. sla: Float! # The number of incoming calls - calls: Long! + callsPerSec: Long! + # Unit: millisecond + responseTimePerSec: Int! # ref: http://www.apdex.org/ # Max value is 1 # 2 Digits after floating point. @@ -19,9 +21,6 @@ type ApplicationNode implements Node { numOfServerAlarm: Int! # The number of services alerting numOfServiceAlarm: Int! - # Incoming request node, means User or outside system access the cluster from this. - # Recommend the UI generate a User node for each incoming node - isIncomingNode: Boolean } # The conjectural node generated by exit span diff --git a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/common.graphqls b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/common.graphqls index e4d7e10ca..b8bff31a5 100644 --- a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/common.graphqls +++ b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/common.graphqls @@ -87,6 +87,12 @@ interface Node { type: String } +# Incoming request node, means User or outside system access the cluster from this. +type VisualUserNode implements Node { + id: ID! + name: String +} + # The Call represents a directed distributed call, # from the `source` to the `target`. type Call { From 50e09852db7c8b5f0f700621eddd4f178a7d21e4 Mon Sep 17 00:00:00 2001 From: wusheng Date: Thu, 11 Jan 2018 16:19:48 +0800 Subject: [PATCH 05/10] add constant values --- .../src/main/resources/ui-graphql/common.graphqls | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/common.graphqls b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/common.graphqls index b8bff31a5..f698908d5 100644 --- a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/common.graphqls +++ b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/common.graphqls @@ -90,7 +90,10 @@ interface Node { # Incoming request node, means User or outside system access the cluster from this. type VisualUserNode implements Node { id: ID! - name: String + # Constant, value = "User" + name: String! + # Constant, value = "USER" + type: String! } # The Call represents a directed distributed call, From eaef6f106c45d362bf63ca3fb2712da915085d4b Mon Sep 17 00:00:00 2001 From: wusheng Date: Thu, 11 Jan 2018 18:52:45 +0800 Subject: [PATCH 06/10] Fix a compile issue --- .../src/main/resources/ui-graphql/common.graphqls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/common.graphqls b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/common.graphqls index f698908d5..04f21eeb3 100644 --- a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/common.graphqls +++ b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/common.graphqls @@ -93,7 +93,7 @@ type VisualUserNode implements Node { # Constant, value = "User" name: String! # Constant, value = "USER" - type: String! + type: String } # The Call represents a directed distributed call, From 225903a92a5590014a353206d9b2cb49c9a66c4d Mon Sep 17 00:00:00 2001 From: wu-sheng Date: Fri, 12 Jan 2018 09:48:49 +0800 Subject: [PATCH 07/10] Fix missing parts. --- .../src/main/resources/ui-graphql/alarm.graphqls | 7 ++++++- .../main/resources/ui-graphql/application-layer.graphqls | 6 +++--- .../src/main/resources/ui-graphql/service-layer.graphqls | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/alarm.graphqls b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/alarm.graphqls index 9cb54a7de..b60d0a126 100644 --- a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/alarm.graphqls +++ b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/alarm.graphqls @@ -1,3 +1,8 @@ +type Alarm { + items: [AlarmItem!]! + count: Int! +} + type AlarmItem { # Typical include: Application Code + cause type. This is a short description. title: String! @@ -21,5 +26,5 @@ enum CauseType { } extend type Query { - loadAlertList(keyword: String, alertType: AlarmType, duration:Duration!, paging: Pagination!):[AlarmItem!]! + loadAlertList(keyword: String, alertType: AlarmType, duration:Duration!, paging: Pagination!): Alarm } \ No newline at end of file diff --git a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/application-layer.graphqls b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/application-layer.graphqls index e7f72bfef..5620e96e0 100644 --- a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/application-layer.graphqls +++ b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/application-layer.graphqls @@ -32,8 +32,8 @@ type ConjecturalNode implements Node { extend type Query { - getAllApplication(duration: Duration!): [ApplicationNode] + getAllApplication(duration: Duration!): [ApplicationNode!]! getApplicationTopology(applicationId: ID!, duration: Duration!): Topology - getSlowService(applicationId: ID!, duration: Duration, top: Int!): [ServiceInfo!] - getServerThroughput(applicationId: ID!, duration: Duration!, top: Int!): [AppServerInfo!] + getSlowService(applicationId: ID!, duration: Duration!, top: Int!): [ServiceInfo!]! + getServerThroughput(applicationId: ID!, duration: Duration!, top: Int!): [AppServerInfo!]! } diff --git a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/service-layer.graphqls b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/service-layer.graphqls index 3e33c8f9e..a5b44557a 100644 --- a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/service-layer.graphqls +++ b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/service-layer.graphqls @@ -27,7 +27,7 @@ type TraceItem { } extend type Query { - searchService(keyword: String!, duration: Duration!): [ServiceNode] + searchService(keyword: String!, duration: Duration!, topN: Int!): [ServiceNode!]! getServiceResponseTimeTrend(serviceId: ID!, duration: Duration!): ResponseTimeTrend getServiceTPSTrend(serviceId: ID!, duration: Duration!): ThroughputTrend getServiceSLATrend(serviceId: ID!, duration: Duration!): SLATrend From 41d7b5cb54a4e97d073b9d2449c19d67926ce412 Mon Sep 17 00:00:00 2001 From: wu-sheng Date: Fri, 12 Jan 2018 14:14:12 +0800 Subject: [PATCH 08/10] Add a query service --- .../src/main/resources/ui-graphql/server-layer.graphqls | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/server-layer.graphqls b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/server-layer.graphqls index 1d01ec211..de4134735 100644 --- a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/server-layer.graphqls +++ b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/server-layer.graphqls @@ -33,7 +33,8 @@ type MemoryTrend { } extend type Query { - searchServer(keyword: String!, duration: Duration!): [AppServerInfo] + searchServer(keyword: String!, duration: Duration!): [AppServerInfo!]! + getAllServer(applicationId: ID!, duration: Duration!): [AppServerInfo!]! getServerResponseTimeTrend(serverId: ID!, duration: Duration!): ResponseTimeTrend getServerTPSTrend(serverId: ID!, duration: Duration!): ThroughputTrend getCPUTrend(serverId: ID!, duration: Duration!): CPUTrend From 8f260f8eb1ef373791febf686c39bc8dade8c19d Mon Sep 17 00:00:00 2001 From: wusheng Date: Fri, 12 Jan 2018 23:28:21 +0800 Subject: [PATCH 09/10] Update trace type. --- .../main/resources/ui-graphql/trace.graphqls | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/trace.graphqls b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/trace.graphqls index b52ea0fe4..d867caba6 100644 --- a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/trace.graphqls +++ b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/trace.graphqls @@ -34,21 +34,14 @@ enum QueryOrder { # The trace represents a distributed trace, includes all segments and spans. type Trace { - traceId: ID! - segments: [Segment!]! -} - -type Segment { - segmentId: ID! - appName: String! - isSizeLimited: Boolean! spans: [Span!]! } type Span { - refs: [Ref!]! + traceId: ID! + segmentId: ID! spanId: Int! - parentSpanId: Int! + refs: [Ref!]! startTime: Long! endTime: Long! operationName: String @@ -65,12 +58,20 @@ type Span { } # Ref represents the link between the segment and its parents. +# The parent(ref) may not exists, which means batch process. +# The UI should display a list, representing the other trace IDs. type Ref { + traceId: ID! parentSegmentId: ID! parentSpanId: Int! # Ref type represents why did the ref happen. # Include: 1) CrossProcess 2) CrossThread - type: String! + type: RefType! +} + +enum RefType { + CROSS_PROCESS, + CROSS_THREAD } type KeyValue { @@ -86,4 +87,4 @@ type LogEntity { extend type Query { queryBasicTraces(condition: TraceQueryCondition): TraceBrief queryTrace(traceId: ID!): Trace -} \ No newline at end of file +} From 691fb78bc9834bcaf41ed0c292c54cd8b072108c Mon Sep 17 00:00:00 2001 From: wusheng Date: Sat, 13 Jan 2018 22:38:25 +0800 Subject: [PATCH 10/10] Add `isAlarm` for ApplicationNode. --- .../src/main/resources/ui-graphql/application-layer.graphqls | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/application-layer.graphqls b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/application-layer.graphqls index 5620e96e0..91d0b2d79 100644 --- a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/application-layer.graphqls +++ b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/application-layer.graphqls @@ -15,6 +15,9 @@ type ApplicationNode implements Node { # Max value is 1 # 2 Digits after floating point. apdex: Float! + # Whether the application alerts? + # Default value is false. + isAlarm: Boolean! # The number of servers in the application code numOfServer: Int! # The number of servers alerting