-
Notifications
You must be signed in to change notification settings - Fork 7
/
witchcraft-logging-api.yml
586 lines (581 loc) · 19 KB
/
witchcraft-logging-api.yml
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
types:
definitions:
default-package: com.palantir.witchcraft.api.logging
objects:
WrappedLogV1:
docs: |
Wraps a log entry with entity information.
fields:
type:
type: string
docs: '"wrapped.1"'
payload:
type: WrappedLogV1Payload
entityName:
type: string
docs: Artifact part of entity's maven coordinate
entityVersion:
type: string
WrappedLogV1Payload:
union:
serviceLogV1: ServiceLogV1
requestLogV2: RequestLogV2
traceLogV1: TraceLogV1
eventLogV2: EventLogV2
metricLogV1: MetricLogV1
auditLogV2: AuditLogV2
diagnosticLogV1: DiagnosticLogV1
ServiceLogV1:
docs: |
Definition of the service.1 format.
fields:
type:
type: string
docs: '"service.1"'
level:
type: LogLevel
docs: The logger output level. One of {FATAL,ERROR,WARN,INFO,DEBUG,TRACE}.
time:
type: datetime
docs: RFC3339Nano UTC datetime string when the log event was emitted
origin:
type: optional<string>
docs: Class or file name. May include line number.
thread:
type: optional<string>
docs: Thread name
message:
type: string
docs: >
Log message. Palantir Java services using slf4j should not use slf4j placeholders ({}). Logs obtained
from 3rd party libraries or services that use slf4j and contain slf4j placeholders will always produce
`unsafeParams` with numeric indexes corresponding to the zero-indexed order of placeholders. Renderers
should substitute numeric parameters from `unsafeParams` and may leave placeholders that do not match
indexes as the original placeholder text.
params:
type: map<string, any>
docs: Known-safe parameters (redaction may be used to make params knowably safe, but is not required).
uid:
type: optional<UserId>
docs: |
User id (if available).
sid:
type: optional<SessionId>
docs: Session id (if available)
tokenId:
type: optional<TokenId>
docs: API token id (if available)
traceId:
type: optional<TraceId>
docs: Zipkin trace id (if available)
stacktrace:
type: optional<string>
docs: >
Language-specific stack trace. Content is knowably safe. Renderers should substitute named placeholders
({name}, for name as a key) with keyed value from unsafeParams and leave non-matching keys as the original
placeholder text.
unsafeParams:
type: map<string, any>
docs: Unredacted parameters
tags:
type: map<string, string>
docs: Additional dimensions that describe the instance of the log event
RequestLog:
union:
v1: RequestLogV1
v2: RequestLogV2
RequestLogV2:
docs: |
Definition of the request.2 format.
fields:
type: string
time: datetime
method:
type: optional<string>
docs: |
HTTP method of request
protocol:
type: string
docs: |
Protocol, e.g. `HTTP/1.1`, `HTTP/2`
path:
type: string
docs: |
Path of request. If templated, the unrendered path, e.g.: `/catalog/dataset/{datasetId}`, `/{rid}/paths/contents/{path:.*}`.
params:
type: map<string, any>
docs: |
Known-safe parameters
status:
type: integer
docs: |
HTTP status code of response
requestSize:
type: safelong
docs: |
Size of request (bytes)
responseSize:
type: safelong
docs: |
Size of response (bytes)
duration:
type: safelong
docs: |
Amount of time spent handling request (microseconds)
uid:
type: optional<UserId>
docs: |
User id (if available)
sid:
type: optional<SessionId>
docs: |
Session id (if available)
tokenId:
type: optional<TokenId>
docs: |
API token id (if available)
traceId:
type: optional<TraceId>
docs: |
Zipkin trace id (if available)
unsafeParams:
type: map<string, any>
docs: |
Unredacted parameters such as path, query and header parameters
RequestLogV1:
docs: |
Definition of the request.1 format.
fields:
type: string
time: datetime
method:
type: optional<string>
docs: |
HTTP method of request
protocol:
type: string
docs: |
Protocol, e.g. `HTTP/1.1`, `HTTP/2`
path:
type: string
docs: |
Path of request. If templated, the unrendered path, e.g.: `/catalog/dataset/{datasetId}`, `/{rid}/paths/contents/{path:.*}`.
pathParams:
type: map<string, any>
docs: |
Known-safe path parameters
queryParams:
type: map<string, any>
docs: |
Known-safe query parameters
headerParams:
type: map<string, any>
docs: |
Known-safe header parameters
bodyParams:
type: map<string, any>
docs: |
Known-safe body parameters
status:
type: integer
docs: |
HTTP status code of response
requestSize:
type: string
docs: |
Size of request (bytes). string to allow large numbers.
responseSize:
type: string
docs: |
Size of response (bytes). string to allow large numbers.
duration:
type: integer
docs: |
Amount of time spent handling request (microseconds)
uid:
type: optional<UserId>
docs: |
User id (if available)
sid:
type: optional<SessionId>
docs: |
Session id (if available)
tokenId:
type: optional<TokenId>
docs: |
API token id (if available)
traceId:
type: optional<TraceId>
docs: |
Zipkin trace id (if available)
unsafeParams:
type: map<string, any>
docs: |
Unredacted parameters such as path, query and header parameters
TraceLogV1:
docs: |
Definition of the trace.1 format.
fields:
type: string
time: datetime
uid: optional<UserId>
sid: optional<SessionId>
tokenId: optional<TokenId>
unsafeParams: map<string, any>
span: Span
Span:
docs: A Zipkin-compatible Span object.
fields:
traceId:
type: string
docs: |
16-digit hex trace identifier
id:
type: string
docs: |
16-digit hex span identifier
name:
type: string
docs: |
Name of the span (typically the operation/RPC/method name for corresponding to this span)
parentId:
type: optional<string>
docs: |
16-digit hex identifer of the parent span
timestamp:
type: safelong
docs: |
Timestamp of the start of this span (epoch microsecond value)
duration:
type: safelong
docs: |
Duration of this span (microseconds)
annotations: list<Annotation>
Annotation:
docs: A Zipkin-compatible Annotation object.
fields:
timestamp:
type: safelong
docs: |
Time annotation was created (epoch microsecond value)
value:
type: string
docs: |
Value encapsulated by this annotation
endpoint: Endpoint
Endpoint:
fields:
serviceName:
type: string
docs: |
Name of the service that generated the annotation
ipv4:
type: optional<string>
docs: |
IPv4 address of the machine that generated this annotation (`xxx.xxx.xxx.xxx`)
ipv6:
type: optional<string>
docs: |
IPv6 address of the machine that generated this annotation (standard hextet form)
EventLogV1:
docs: Definition of the event.1 format.
fields:
type: string
time: datetime
eventName:
type: string
docs: |
Dot-delimited name of event, e.g. `com.foundry.compass.api.Compass.http.ping.failures`
eventType:
type: string
docs: |
Type of event being represented, e.g. `gauge`, `histogram`, `counter`
values:
type: map<string, any>
docs: |
Observations, measurements and context associated with the event
uid:
type: optional<UserId>
docs: |
User id (if available)
sid:
type: optional<SessionId>
docs: |
Session id (if available)
tokenId:
type: optional<TokenId>
docs: |
API token id (if available)
unsafeParams:
type: map<string, any>
docs: |
Unsafe metadata describing the event
EventLogV2:
docs: Definition of the event.2 format.
fields:
type: string
time: datetime
eventName:
type: string
docs: |
Dot-delimited name of event, e.g. `com.foundry.compass.api.Compass.http.ping.failures`
values:
type: map<string, any>
docs: |
Observations, measurements and context associated with the event
uid:
type: optional<UserId>
docs: |
User id (if available)
sid:
type: optional<SessionId>
docs: |
Session id (if available)
tokenId:
type: optional<TokenId>
docs: |
API token id (if available)
traceId:
type: optional<TraceId>
docs: |
Zipkin trace id (if available)
unsafeParams:
type: map<string, any>
docs: |
Unsafe metadata describing the event
tags:
type: map<string, string>
docs: Additional dimensions that describe the instance of the log event
MetricLogV1:
docs: Definition of the metric.1 format.
fields:
type: string
time: datetime
metricName:
type: string
docs: |
Dot-delimited name of metric, e.g. `com.foundry.compass.api.Compass.http.ping.failures`
metricType:
type: string
docs: |
Type of metric being represented, e.g. `gauge`, `histogram`, `counter`
values:
type: map<string, any>
docs: |
Observations, measurements and context associated with the metric
tags:
type: map<string, string>
docs: |
Additional dimensions that describe the instance of the metric
uid:
type: optional<UserId>
docs: |
User id (if available)
sid:
type: optional<SessionId>
docs: |
Session id (if available)
tokenId:
type: optional<TokenId>
docs: |
API token id (if available)
unsafeParams:
type: map<string, any>
docs: |
Unsafe metadata describing the event
BeaconLogV1:
docs: |
Definition of the beacon.1 format.
fields:
type: string
time: datetime
eventType:
type: string
docs: |
Dot-delimited name for the structure of the params block, e.g. `compass.SearchEvent.v1`
appName:
type: string
docs: |
Name of the application that created the log
appVersion:
type: string
docs: |
Version of the application that created the log
params:
type: map<string, any>
docs: |
Known-safe parameters (redaction may be used to make params knowably safe, but is not required)
browserId:
type: optional<string>
docs: |
Browser identifier (if available)
uid:
type: optional<UserId>
docs: |
User id (if available)
sid:
type: optional<SessionId>
docs: |
Session id (if available)
traceId:
type: optional<TraceId>
docs: |
Zipkin trace id (if available)
unsafeParams:
type: map<string, any>
docs: |
Unredacted parameters
AuditLogV2:
docs: |
Definition of the audit.2 format.
fields:
type:
type: string
docs: '"audit.2"'
time: datetime
uid:
type: optional<UserId>
docs: |
User id (if available). This is the most downstream caller.
sid:
type: optional<SessionId>
docs: |
Session id (if available)
tokenId:
type: optional<TokenId>
docs: |
API token id (if available)
traceId:
type: optional<TraceId>
docs: |
Zipkin trace id (if available)
otherUids:
type: list<UserId>
docs: |
All users upstream of the user currently taking an action. The first element in this list is the uid of the most upstream caller. This list does not include the `uid`.
origin:
type: optional<string>
docs: |
Best-effort identifier of the originating machine, e.g. an IP address, a Kubernetes node identifier,
or similar
name:
type: string
docs: |
Name of the audit event, e.g. PUT_FILE
result:
type: AuditResult
docs: |
Indicates whether the request was successful or the type of failure, e.g. ERROR or UNAUTHORIZED
requestParams:
type: map<string, any>
docs: |
The parameters known at method invocation time.
resultParams:
type: map<string, any>
docs: |
Information derived within a method, commonly parts of the return value.
DiagnosticLogV1:
docs: |
Definition of the diagnostic.1 format.
fields:
type:
type: string
docs: '"diagnostic.1"'
time: datetime
diagnostic:
type: Diagnostic
docs: The diagnostic being logged.
unsafeParams:
type: map<string, any>
docs: |
Unredacted parameters
Diagnostic:
union:
generic: GenericDiagnostic
threadDump: ThreadDumpV1
GenericDiagnostic:
fields:
diagnosticType:
type: string
docs: An identifier for the type of diagnostic represented.
value:
type: any
docs: Observations, measurements and context associated with the diagnostic.
ThreadDumpV1:
fields:
threads:
type: list<ThreadInfoV1>
docs: >
Information about each of the threads in the thread dump. "Thread" may refer to a
userland thread such as a goroutine, or an OS-level thread.
ThreadInfoV1:
fields:
id:
type: optional<safelong>
docs: The ID of the thread.
name:
type: optional<string>
docs: >
The name of the thread. Note that thread names may include unsafe information such
as the path of the HTTP request being processed. It must be safely redacted.
stackTrace:
type: list<StackFrameV1>
docs: >
A list of stack frames for the thread, ordered with the current frame first.
params:
type: map<string, any>
docs: Other thread-level information.
StackFrameV1:
fields:
address:
type: optional<string>
docs: >
The address of the execution point of this stack frame. This is a string because a
safelong can't represent the full 64 bit address space.
procedure:
type: optional<string>
docs: >
The identifier of the procedure containing the execution point of this stack frame.
This is a fully qualified method name in Java and a demangled symbol name in native
code, for example. Note that procedure names may include unsafe information if a
service is, for exmaple, running user-defined code. It must be safely redacted.
file:
type: optional<string>
docs: >
The name of the file containing the source location of the execution point of this
stack frame. Note that file names may include unsafe information if a service is,
for example, running user-defined code. It must be safely redacted.
line:
type: optional<integer>
docs: >
The line number of the source location of the execution point of this stack frame.
params:
type: map<string, any>
docs: Other frame-level information.
AuditResult:
values:
- SUCCESS
- UNAUTHORIZED
- ERROR
UnionEventLog:
docs: Union type containing log types that are logged to event.log.
union:
eventLog: EventLogV1
eventLogV2: EventLogV2
beaconLog: BeaconLogV1
LogLevel:
values:
- FATAL
- ERROR
- WARN
- INFO
- DEBUG
- TRACE
UserId:
alias: string
SessionId:
alias: string
TokenId:
alias: string
TraceId:
alias: string