From d3b357a447a6cf4b024cb72b7630fb748e9d5eab Mon Sep 17 00:00:00 2001 From: wu-sheng Date: Thu, 28 Dec 2017 16:16:12 +0800 Subject: [PATCH] Finish all services and readme. --- .../src/main/resources/ui-graphql/README.md | 34 ++++++++++++ .../main/resources/ui-graphql/trace.graphqls | 52 +++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/README.md diff --git a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/README.md b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/README.md new file mode 100644 index 000000000..eba013053 --- /dev/null +++ b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/README.md @@ -0,0 +1,34 @@ +# Abstract +**apm-ui-protocol** declares all services, using GraphQL API style, which provide by Collector UI module. + +## Services +### [Common](common.graphqls) + +Include common objects, which used in global + +### [Overview Layer Service](overview-layer.graphqls) + +Query data without specific application, server or service. It includes info for overview the whole cluster. + +### [Application Layer Service](application-layer.graphqls) + +Query application related data with specific application code. + +### [Server Layer Service](server-layer.graphqls) + +Query server related data with specific server id. + +### [Service Layer Service](service-layer.graphqls) + +Query service related data with specific service id + +### [Trace Service](trace.graphqls) + +Query trace by some conditions. + +### [Alarm Service](alarm.graphqls) + +Query alarm info. + +## Version +1.0-alpha \ No newline at end of file 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 822f7ce8f..4e2e1a0ec 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 @@ -32,6 +32,58 @@ enum QueryOrder { BY_DURATION } +# 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!] + spanId: Int! + parentSpanId: Int! + startTime: Long! + endTime: Long! + operationName: String + # There are three span types: Local, Entry and Exit + type: String! + # Peer network id, e.g. host+port, ip+port + peer: String + component: String + isError: Boolean + # There are 5 layers: Unknown, Database, RPCFramework, Http, MQ and Cache + layer: String + tags: [KeyValue!] + logs: [LogEntity!] +} + +# Ref represents the link between the segment and its parents. +type Ref { + parentSegmentId: ID! + parentSpanId: Int! + # Ref type represents why did the ref happen. + # Include: 1) CrossProcess 2) CrossThread + type: String! +} + +type KeyValue { + key: String! + value: String +} + +type LogEntity { + time: String + data: [KeyValue!] +} + extend type Query { queryBasicTraces(condition: TraceQueryCondition): TraceBrief + queryTrace(traceId: ID!): Trace } \ No newline at end of file