forked from elastic/apm-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
span.json
719 lines (719 loc) · 21.4 KB
/
span.json
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
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
{
"$id": "docs/spec/v2/span",
"type": "object",
"properties": {
"action": {
"description": "Action holds the specific kind of event within the sub-type represented by the span (e.g. query, connect)",
"type": [
"null",
"string"
],
"maxLength": 1024
},
"child_ids": {
"description": "ChildIDs holds a list of successor transactions and/or spans.",
"type": [
"null",
"array"
],
"items": {
"type": "string",
"maxLength": 1024
},
"minItems": 0
},
"context": {
"description": "Context holds arbitrary contextual information for the event.",
"type": [
"null",
"object"
],
"properties": {
"db": {
"description": "Database contains contextual data for database spans",
"type": [
"null",
"object"
],
"properties": {
"instance": {
"description": "Instance name of the database.",
"type": [
"null",
"string"
]
},
"link": {
"description": "Link to the database server.",
"type": [
"null",
"string"
],
"maxLength": 1024
},
"rows_affected": {
"description": "RowsAffected shows the number of rows affected by the statement.",
"type": [
"null",
"integer"
]
},
"statement": {
"description": "Statement of the recorded database event, e.g. query.",
"type": [
"null",
"string"
]
},
"type": {
"description": "Type of the recorded database event., e.g. sql, cassandra, hbase, redis.",
"type": [
"null",
"string"
]
},
"user": {
"description": "User is the username with which the database is accessed.",
"type": [
"null",
"string"
]
}
}
},
"destination": {
"description": "Destination contains contextual data about the destination of spans",
"type": [
"null",
"object"
],
"properties": {
"address": {
"description": "Address is the destination network address: hostname (e.g. 'localhost'), FQDN (e.g. 'elastic.co'), IPv4 (e.g. '127.0.0.1') IPv6 (e.g. '::1')",
"type": [
"null",
"string"
],
"maxLength": 1024
},
"port": {
"description": "Port is the destination network port (e.g. 443)",
"type": [
"null",
"integer"
]
},
"service": {
"description": "Service describes the destination service",
"type": [
"null",
"object"
],
"properties": {
"name": {
"description": "Name is the identifier for the destination service, e.g. 'http://elastic.co', 'elasticsearch', 'rabbitmq'",
"type": "string",
"maxLength": 1024
},
"resource": {
"description": "Resource identifies the destination service resource being operated on e.g. 'http://elastic.co:80', 'elasticsearch', 'rabbitmq/queue_name'",
"type": "string",
"maxLength": 1024
},
"type": {
"description": "Type of the destination service, e.g. db, elasticsearch. Should typically be the same as span.type.",
"type": "string",
"maxLength": 1024
}
},
"required": [
"name",
"resource",
"type"
]
}
}
},
"experimental": {
"description": "Experimental information is only processed when APM Server is started in development mode and should only be used by APM agent developers implementing new, unreleased features. The format is unspecified."
},
"http": {
"description": "HTTP contains contextual information when the span concerns an HTTP request.",
"type": [
"null",
"object"
],
"properties": {
"method": {
"description": "Method holds information about the method of the HTTP request.",
"type": [
"null",
"string"
],
"maxLength": 1024
},
"response": {
"description": "Response describes the HTTP response information in case the event was created as a result of an HTTP request.",
"type": [
"null",
"object"
],
"properties": {
"decoded_body_size": {
"description": "DecodedBodySize holds the size of the decoded payload.",
"type": [
"null",
"number"
]
},
"encoded_body_size": {
"description": "EncodedBodySize holds the size of the encoded payload.",
"type": [
"null",
"number"
]
},
"headers": {
"description": "Headers holds the http headers sent in the http response.",
"type": [
"null",
"object"
],
"additionalProperties": false,
"patternProperties": {
"[.*]*$": {
"type": [
"null",
"array",
"string"
],
"items": {
"type": "string"
}
}
}
},
"status_code": {
"description": "StatusCode sent in the http response.",
"type": [
"null",
"integer"
]
},
"transfer_size": {
"description": "TransferSize holds the total size of the payload.",
"type": [
"null",
"number"
]
}
}
},
"status_code": {
"description": "Deprecated: Use Response.StatusCode instead. StatusCode sent in the http response.",
"type": [
"null",
"integer"
]
},
"url": {
"description": "URL is the raw url of the correlating HTTP request.",
"type": [
"null",
"string"
]
}
}
},
"message": {
"description": "Message holds details related to message receiving and publishing if the captured event integrates with a messaging system",
"type": [
"null",
"object"
],
"properties": {
"age": {
"description": "Age of the message. If the monitored messaging framework provides a timestamp for the message, agents may use it. Otherwise, the sending agent can add a timestamp in milliseconds since the Unix epoch to the message's metadata to be retrieved by the receiving agent. If a timestamp is not available, agents should omit this field.",
"type": [
"null",
"object"
],
"properties": {
"ms": {
"description": "Age of the message in milliseconds.",
"type": [
"null",
"integer"
]
}
}
},
"body": {
"description": "Body of the received message, similar to an HTTP request body",
"type": [
"null",
"string"
]
},
"headers": {
"description": "Headers received with the message, similar to HTTP request headers.",
"type": [
"null",
"object"
],
"additionalProperties": false,
"patternProperties": {
"[.*]*$": {
"type": [
"null",
"array",
"string"
],
"items": {
"type": "string"
}
}
}
},
"queue": {
"description": "Queue holds information about the message queue where the message is received.",
"type": [
"null",
"object"
],
"properties": {
"name": {
"description": "Name holds the name of the message queue where the message is received.",
"type": [
"null",
"string"
],
"maxLength": 1024
}
}
}
}
},
"service": {
"description": "Service related information can be sent per span. Information provided here will override the more generic information retrieved from metadata, missing service fields will be retrieved from the metadata information.",
"type": [
"null",
"object"
],
"properties": {
"agent": {
"description": "Agent holds information about the APM agent capturing the event.",
"type": [
"null",
"object"
],
"properties": {
"ephemeral_id": {
"description": "EphemeralID is a free format ID used for metrics correlation by agents",
"type": [
"null",
"string"
],
"maxLength": 1024
},
"name": {
"description": "Name of the APM agent capturing information.",
"type": [
"null",
"string"
],
"maxLength": 1024
},
"version": {
"description": "Version of the APM agent capturing information.",
"type": [
"null",
"string"
],
"maxLength": 1024
}
}
},
"environment": {
"description": "Environment in which the monitored service is running, e.g. `production` or `staging`.",
"type": [
"null",
"string"
],
"maxLength": 1024
},
"framework": {
"description": "Framework holds information about the framework used in the monitored service.",
"type": [
"null",
"object"
],
"properties": {
"name": {
"description": "Name of the used framework",
"type": [
"null",
"string"
],
"maxLength": 1024
},
"version": {
"description": "Version of the used framework",
"type": [
"null",
"string"
],
"maxLength": 1024
}
}
},
"language": {
"description": "Language holds information about the programming language of the monitored service.",
"type": [
"null",
"object"
],
"properties": {
"name": {
"description": "Name of the used programming language",
"type": [
"null",
"string"
],
"maxLength": 1024
},
"version": {
"description": "Version of the used programming language",
"type": [
"null",
"string"
],
"maxLength": 1024
}
}
},
"name": {
"description": "Name of the monitored service.",
"type": [
"null",
"string"
],
"maxLength": 1024,
"pattern": "^[a-zA-Z0-9 _-]+$"
},
"node": {
"description": "Node must be a unique meaningful name of the service node.",
"type": [
"null",
"object"
],
"properties": {
"configured_name": {
"description": "Name of the service node",
"type": [
"null",
"string"
],
"maxLength": 1024
}
}
},
"runtime": {
"description": "Runtime holds information about the language runtime running the monitored service",
"type": [
"null",
"object"
],
"properties": {
"name": {
"description": "Name of the language runtime",
"type": [
"null",
"string"
],
"maxLength": 1024
},
"version": {
"description": "Version of the language runtime",
"type": [
"null",
"string"
],
"maxLength": 1024
}
}
},
"version": {
"description": "Version of the monitored service.",
"type": [
"null",
"string"
],
"maxLength": 1024
}
}
},
"tags": {
"description": "Tags are a flat mapping of user-defined tags. Allowed value types are string, boolean and number values. Tags are indexed and searchable.",
"type": [
"null",
"object"
],
"additionalProperties": {
"type": [
"null",
"string",
"boolean",
"number"
],
"maxLength": 1024
}
}
}
},
"duration": {
"description": "Duration of the span in milliseconds",
"type": "number",
"minimum": 0
},
"id": {
"description": "ID holds the hex encoded 64 random bits ID of the event.",
"type": "string",
"maxLength": 1024
},
"name": {
"description": "Name is the generic designation of a span in the scope of a transaction.",
"type": "string",
"maxLength": 1024
},
"outcome": {
"description": "Outcome of the span: success, failure, or unknown. Outcome may be one of a limited set of permitted values describing the success or failure of the span. It can be used for calculating error rates for outgoing requests.",
"type": [
"null",
"string"
],
"enum": [
"success",
"failure",
"unknown",
null
]
},
"parent_id": {
"description": "ParentID holds the hex encoded 64 random bits ID of the parent transaction or span.",
"type": "string",
"maxLength": 1024
},
"sample_rate": {
"description": "SampleRate applied to the monitored service at the time where this span was recorded.",
"type": [
"null",
"number"
]
},
"stacktrace": {
"description": "Stacktrace connected to this span event.",
"type": [
"null",
"array"
],
"items": {
"type": "object",
"properties": {
"abs_path": {
"description": "AbsPath is the absolute path of the frame's file.",
"type": [
"null",
"string"
]
},
"classname": {
"description": "Classname of the frame.",
"type": [
"null",
"string"
]
},
"colno": {
"description": "ColumnNumber of the frame.",
"type": [
"null",
"integer"
]
},
"context_line": {
"description": "ContextLine is the line from the frame's file.",
"type": [
"null",
"string"
]
},
"filename": {
"description": "Filename is the relative name of the frame's file.",
"type": [
"null",
"string"
]
},
"function": {
"description": "Function represented by the frame.",
"type": [
"null",
"string"
]
},
"library_frame": {
"description": "LibraryFrame indicates whether the frame is from a third party library.",
"type": [
"null",
"boolean"
]
},
"lineno": {
"description": "LineNumber of the frame.",
"type": [
"null",
"integer"
]
},
"module": {
"description": "Module to which the frame belongs to.",
"type": [
"null",
"string"
]
},
"post_context": {
"description": "PostContext is a slice of code lines immediately before the line from the frame's file.",
"type": [
"null",
"array"
],
"items": {
"type": "string"
},
"minItems": 0
},
"pre_context": {
"description": "PreContext is a slice of code lines immediately after the line from the frame's file.",
"type": [
"null",
"array"
],
"items": {
"type": "string"
},
"minItems": 0
},
"vars": {
"description": "Vars is a flat mapping of local variables of the frame.",
"type": [
"null",
"object"
]
}
},
"anyOf": [
{
"properties": {
"classname": {
"type": "string"
}
},
"required": [
"classname"
]
},
{
"properties": {
"filename": {
"type": "string"
}
},
"required": [
"filename"
]
}
]
},
"minItems": 0
},
"start": {
"description": "Start is the offset relative to the transaction's timestamp identifying the start of the span, in milliseconds.",
"type": [
"null",
"number"
]
},
"subtype": {
"description": "Subtype is a further sub-division of the type (e.g. postgresql, elasticsearch)",
"type": [
"null",
"string"
],
"maxLength": 1024
},
"sync": {
"description": "Sync indicates whether the span was executed synchronously or asynchronously.",
"type": [
"null",
"boolean"
]
},
"timestamp": {
"description": "Timestamp holds the recorded time of the event, UTC based and formatted as microseconds since Unix epoch",
"type": [
"null",
"integer"
]
},
"trace_id": {
"description": "TraceID holds the hex encoded 128 random bits ID of the correlated trace.",
"type": "string",
"maxLength": 1024
},
"transaction_id": {
"description": "TransactionID holds the hex encoded 64 random bits ID of the correlated transaction.",
"type": [
"null",
"string"
],
"maxLength": 1024
},
"type": {
"description": "Type holds the span's type, and can have specific keywords within the service's domain (eg: 'request', 'backgroundjob', etc)",
"type": "string",
"maxLength": 1024
}
},
"required": [
"duration",
"id",
"name",
"parent_id",
"trace_id",
"type"
],
"anyOf": [
{
"properties": {
"start": {
"type": "number"
}
},
"required": [
"start"
]
},
{
"properties": {
"timestamp": {
"type": "integer"
}
},
"required": [
"timestamp"
]
}
]
}