-
Notifications
You must be signed in to change notification settings - Fork 67
/
trace.graphqls
184 lines (170 loc) · 6.36 KB
/
trace.graphqls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# 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.
# The list of traces
type TraceBrief {
traces: [BasicTrace!]!
#For OAP internal query debugging
debuggingTrace: DebuggingTrace
}
# Trace basic info
type BasicTrace {
segmentId: String!
endpointNames: [String!]!
duration: Int!
start: String!
isError: Boolean
traceIds: [String!]!
}
# Represent the conditions used for query TraceBrief
input TraceQueryCondition {
# The value of 0 means all services.
serviceId: ID
serviceInstanceId: ID
traceId: String
endpointId: ID
# The time range of traces started
queryDuration: Duration
# The min time of trace
minTraceDuration: Int
# The max time of trace
maxTraceDuration: Int
traceState: TraceState!
queryOrder: QueryOrder!
# Map to the tags included in the traces
tags: [SpanTag!]
paging: Pagination!
}
input SpanTag {
key: String!
value: String
}
enum TraceState {
ALL
SUCCESS
ERROR
}
enum QueryOrder {
BY_START_TIME
BY_DURATION
}
# The trace represents a distributed trace, includes all segments and spans.
type Trace {
spans: [Span!]!
#For OAP internal query debugging
debuggingTrace: DebuggingTrace
}
type Span {
traceId: ID!
segmentId: ID!
spanId: Int!
parentSpanId: Int!
refs: [Ref!]!
serviceCode: String!
serviceInstanceName: ID!
# The start timestamp of the span in millisecond
startTime: Long!
# The end timestamp of the span in millisecond
endTime: Long!
endpointName: String
# There are three span types: Local, Entry and Exit
type: String!
# Peer network id, e.g. host+port, ip+port
peer: String
# The name of the tech stack component used for the execution represented by the span.
component: String
# The error status is true when the execution returns error code or throws an exception(determined by the language).
isError: Boolean
# There are 5 layers: Unknown, Database, RPCFramework, Http, MQ and Cache
layer: String
# key-value(string) pairs to specify unique attributes of ths span
tags: [KeyValue!]!
# The events happen of the span, especially in-process.
logs: [LogEntity!]!
# The attached events happen in the span's context but out-of-process.
# Check SpanAttachedEvent definition for more details.
attachedEvents: [SpanAttachedEvent!]!
}
# 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: RefType!
}
enum RefType {
CROSS_PROCESS,
CROSS_THREAD
}
type LogEntity {
# The timestamp of the log in millisecond
time: Long!
data: [KeyValue!]
}
# An instantaneous point on the time-line.
# An instant represents a data point accurate to the nanosecond.
# It is constituted by a long representing epoch-seconds and an int representing nanosecond-of-second,
# which will always be between 0 and 999,999,999
type Instant {
# The number of seconds from the epoch of 1970-01-01T00:00:00Z.
seconds: Long!
# The number of nanoseconds, later along the time-line, from the seconds field.
# This is always positive, and never exceeds 999,999,999.
nanos: Int!
}
# SpanAttachedEvent represents an attached event for a traced RPC.
# When an RPC is being traced by the in-process language agent, a span would be reported by the client-side agent.
# And the rover would be aware of this RPC due to the existing tracing header.
# Then, the rover agent collects extra information from the OS level to provide assistance information to diagnose network performance.
#
# Notice, THIS IS ALSO AVAILABLE FOR ZIPKIN SPAN.
# -----------------------------------------------
# In SkyWalking, ZipkinQueryHandler provides full support for all Zipkin span queries.
# SpanAttachedEvent query is supported through the trace query URI: /api/v2/trace/{traceId}
# A new `attachedEvents` field would be added in JSONArray format with SpanAttachedEvent in JSON as elements.
type SpanAttachedEvent {
# The nanosecond timestamp of the event's start time.
# Notice, most unit of timestamp in SkyWalking is milliseconds, but NANO-SECOND is required here.
# Because the attached event happens in the OS syscall level, most of them are executed rapidly.
startTime: Instant!
# The official event name.
# For example, the event name is a method signature from syscall stack.
event: String!
# [Optional] The nanosecond timestamp of the event's end time.
endTime: Instant!
# The tags for this event includes some extra OS level information,
# such as
# 1. net_device used for this exit span.
# 2. network L7 protocol
tags: [KeyValue]!
# The summary of statistics during this event.
# Each statistic provides a name(metric name) to represent the name, and an int64/long as the value.
summary: [KeyNumericValue!]!
}
# Param, if debug is true will enable the query tracing and return DebuggingTrace in the result.
extend type Query {
# Search segment list with given conditions
queryBasicTraces(condition: TraceQueryCondition, debug: Boolean): TraceBrief
# Read the specific trace ID with given trace ID
queryTrace(traceId: ID!, debug: Boolean): Trace
# Read the list of searchable keys
queryTraceTagAutocompleteKeys(duration: Duration!):[String!]
# Search the available value options of the given key.
queryTraceTagAutocompleteValues(tagKey: String! , duration: Duration!):[String!]
}