forked from openzipkin/zipkin-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
zipkin-api.yaml
317 lines (312 loc) · 10.4 KB
/
zipkin-api.yaml
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
swagger: "2.0"
info:
version: "1.0.0"
title: Zipkin API
description: |
Zipkin's Query api is rooted at `api/v1`, on a host that by default listens
on port 9411. It primarily serves the zipkin-ui, although it includes a POST
endpoint that can receive spans.
host: localhost:9411
basePath: /api/v1
schemes:
- http
- https
consumes:
- application/json
produces:
- application/json
paths:
/services:
get:
description: |
Returns a list of all service names associated with annotations.
responses:
'200':
description: Succes
schema:
type: array
items:
type: string
'400':
description: Bad Request Error
/spans:
get:
description: Get all the span names logged by a particular service
parameters:
- name: serviceName
in: query
required: true
description: |
Ex zipkin-server (required) - service that logged an annotation in a
trace. The /services endpoint enumerates possible input values.
type: string
responses:
'200':
description: OK
schema:
type: array
items:
type: string
'400':
description: Bad Request Error
post:
description: |
Uploads a list of spans encoded per content-type, for example json
or thrift (TBinaryProtocol big-endian).
consumes:
- application/json
- application/x-thrift
produces: []
parameters:
- name: span
in: body
description: A list of spans that belong to any trace.
required: true
schema:
$ref: "#/definitions/ListOfSpans"
responses:
'202':
description: Accepted
/traces:
get:
description: |
Invoking this request retrieves traces matching the below filters.
Results should be filtered against endTs, subject to limit and
lookback. For example, if endTs is 10:20 today, limit is 10, and
lookback is 7 days, traces returned should be those nearest to 10:20
today, not 10:20 a week ago.
Time units of endTs and lookback are milliseconds as opposed to
microseconds, the grain of Span.timestamp. Milliseconds is a more
familiar and supported granularity for query, index and windowing
functions
parameters:
- name: serviceName
in: query
required: false
description: |
Ex zipkin-server - service that logged an annotation in a trace.
Required when constraining on parameters except time and duration.
The /services endpoint enumerates possible input values.
type: string
- name: spanName
in: query
required: false
description: |
Ex my_span_name - name of a span in a trace.
Only return traces that contains spans with this name.
type: string
- name: annotationQuery
in: query
type: string
required: false
description: |
Ex. `http.uri=/foo and retried` - If key/value (has an `=`),
constrains against Span.binaryAnnotations of time string. If just
a word, constrains against Span.annotations. Any values are AND
against eachother. This means a span in the trace must match all of
these.
- name: minDuration
in: query
type: integer
description: |
Ex. 100000 (for 100ms). Only return traces whose `Span.duration` is
greater than or equal to minDuration microseconds.
- name: maxDuration
in: query
type: integer
description: |
Only return traces whose Span.duration is less than or equal to
`maxDuration` microseconds. Only valid with minDuration.
- name: endTs
in: query
type: integer
format: int64
description: |
Only return traces where all Span.timestamp are at or before this
time in epoch milliseconds. Defaults to current time.
- name: lookback
type: integer
format: int64
in: query
description: |
Only return traces where all Span.timestamp are at or after
(`endTs - * lookback`) in milliseconds. Defaults to `endTs`, limited
to a system parameter `QUERY_LOOKBACK`.
- name: limit
in: query
default: 10
type: integer
description: |
Maximum number of traces to return. Defaults to 10
responses:
'200':
description: OK
schema:
$ref: "#/definitions/ListOfTraces"
/trace/{traceId}:
get:
parameters:
- name: traceId
in: path
required: true
description: the 64 or 128-bit hex-encoded id of the trace as a path parameter.
type: string
- name: raw
in: query
required: false
description: |
Note this flag has no value. Ex. /trace/{traceId}?raw
Normally, the trace endpoint cleans trace data. For example, it merges
spans by id, adds missing timestamp or duration, corrects clock skew..
Specifying this flag is a debug case, when you are debugging zipkin
logic or zipkin instrumentation, and want to see the input to these
adjusters. For example, this might explain or rule out clock skew.
type: boolean
responses:
'200':
description: OK
schema:
$ref: "#/definitions/Trace"
'404':
description: "`traceId` not found"
/dependencies:
get:
description: |
Returns dependency links derived from spans.
Span names are in lowercase, rpc method for example. Conventionally,
when the span name isn't known, name = "unknown".
parameters:
- name: endTs
in: query
description: |
Only return links from spans where `Span.timestamp` are at or before
this time in epoch milliseconds.
required: true
type: integer
format: int64
- name: lookback
in: query
description: |
Only return links from spans where all Span.timestamp are at or after
(`endTs - * lookback`) in milliseconds. Defaults to `endTs`, limited
to a system parameter `QUERY_LOOKBACK`.
type: integer
format: int64
responses:
'200':
description: OK
schema:
type: array
title: ListOfDependencyLinks
items:
$ref: "#/definitions/DependencyLink"
definitions:
Endpoint:
type: object
title: Endpoint
properties:
serviceName:
type: string
description: 'Classifier of this endpoint in lowercase, such as "acme-frontend"'
ipv4:
type: string
description: 'The text representation of a IPv4 address associated with this endpoint. Ex. 192.168.99.100'
ipv6:
type: string
description: 'The text representation of a IPv6 address associated with this endpoint. Ex. 2001:db8::c001'
port:
type: integer
Annotation:
title: Annotation
type: object
properties:
endpoint:
$ref: "#/definitions/Endpoint"
description: 'The host that recorded the value, primarily for query by service name.'
timestamp:
type: integer
value:
type: string
BinaryAnnotation:
title: BinaryAnnotation
type: object
properties:
key:
type: string
value:
type: string
endpoint:
$ref: '#/definitions/Endpoint'
description: 'The host that recorded the value, primarily for query by service name.'
ListOfSpans:
title: ListOfSpans
description: 'A list of spans with possibly different trace ids, in no particular order'
type: array
items:
$ref: "#/definitions/Span"
Trace:
title: Trace
type: array
description: 'List of spans who have the same trace id. Spans in the trace, and annotations in a span are sorted ascending by timestamp. ie first event should be first in the spans list.'
items:
$ref: "#/definitions/Span"
ListOfTraces:
title: ListOfTraces
type: array
items:
$ref: "#/definitions/Trace"
Span:
title: Span
type: object
properties:
traceId:
type: string
maxLength: 32
minLength: 16
description: 'Randomly generated, unique for a trace, set on all spans within it. 8-byte or 16-byte identifier respectively encoded as 16 or 32 lowercase hex characters.'
name:
type: string
description: 'Span name in lowercase (e.g. rpc method)'
parentId:
type: string
maxLength: 16
minLength: 16
description: 'Parent span id. 8-byte identifier encoded as 16 lowercase hex characters. Can be ommitted or set to nil if span is the root span of a trace.'
id:
type: string
maxLength: 16
minLength: 16
description: 'Id of current span, unique in context of traceId. 8-byte identifier encoded as 16 lowercase hex characters.'
timestamp:
type: integer
format: int64
description: 'Epoch **microseconds** of the start of this span, possibly absent if this an incomplete span.'
duration:
type: integer
format: int64
description: 'Duration in **microseconds** of the critical path, if known. Durations of less than one are rounded up.'
debug:
type: boolean
description: 'Indicator whether this trace was sampled from standard traffic or forced. Usually coupled to the X-B3-Flags header, which when set to true is a request to store this span even if it overrides sampling policy.'
annotations:
title: ListOfAnnotations
type: array
items:
$ref: '#/definitions/Annotation'
binaryAnnotations:
title: ListOfBinaryAnnotations
type: array
items:
$ref: '#/definitions/BinaryAnnotation'
DependencyLink:
title: DependencyLink
type: object
properties:
parent:
type: string
child:
type: string
callCount:
type: integer
errorCount:
type: integer