-
Notifications
You must be signed in to change notification settings - Fork 10
/
config.schema.json
588 lines (588 loc) · 25.2 KB
/
config.schema.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
{
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"CCEventConfig": {
"description": "Chaincode event to listen to",
"properties": {
"block": {
"description": "block",
"type": "number"
},
"chaincodeId": {
"description": "chaincodeid",
"type": "string"
},
"channelName": {
"description": "channel name",
"type": "string"
}
},
"type": "object"
},
"CheckpointConfigSchema": {
"description": "The checkpoint is where fabriclogger keeps track of its state, which blocks have already been processed.\nThis allows it to resume where it left off after being shut down and restarted.",
"properties": {
"filename": {
"default": ".checkpoints",
"description": "File path (relative to the current working directory) where the checkpoint file will be stored",
"type": "string"
},
"saveInterval": {
"description": "Maximum duration before saving updated checkpoint information to disk",
"type": ["string", "number"]
}
},
"type": "object"
},
"ConsoleOutputConfig": {
"description": "Console output prints all generated events and metrics to STDOUT",
"properties": {
"type": {
"enum": ["console"],
"type": "string"
}
},
"type": "object"
},
"DevNullOutputConfig": {
"description": "Null output will just drop all generated events and metrics",
"properties": {
"type": {
"enum": ["null"],
"type": "string"
}
},
"type": "object"
},
"ExponentialBackoffConfig": {
"description": "Exponentially increasing wait time with randomness",
"properties": {
"max": {
"description": "Maximum wait time",
"type": ["string", "number"]
},
"min": {
"description": "Minimum wait time",
"type": ["string", "number"]
},
"type": {
"enum": ["exponential-backoff"],
"type": "string"
}
},
"type": "object"
},
"FabricConfigSchema": {
"properties": {
"asLocalHost": {
"description": "Convert discovered addresses to localhost for docker",
"type": "boolean"
},
"blockType": {
"description": "Block Type full or private",
"enum": ["filtered", "full", "private"],
"type": "string"
},
"ccevents": {
"description": "Chaincode events to listen to",
"items": {
"$ref": "#/definitions/CCEventConfig"
},
"type": "array"
},
"certFile": {
"description": "The signed certificate from the fabric certificate authority",
"type": "string"
},
"channels": {
"description": "Channels to listen to",
"items": {
"type": "string"
},
"type": "array"
},
"clientCertFile": {
"description": "The client certificate file used when mutual TLS is enabled to authenticate with the peer",
"type": "string"
},
"clientKeyFile": {
"description": "The client private key used when mutual TLS is enabled to authenticate with the peer",
"type": "string"
},
"discovery": {
"description": "Enable Discovery service",
"type": "boolean"
},
"keyFile": {
"description": "The private key for the user",
"type": "string"
},
"msp": {
"description": "The name of the MSP that the user is enrolled in",
"type": "string"
},
"networkConfig": {
"description": "Network configuration file",
"type": "string"
},
"user": {
"description": "The username to use for fabric logger",
"type": "string"
}
},
"type": "object"
},
"FileOutputConfig": {
"description": "File output will append all generated messages to a file. (this output type has not been implemented)",
"properties": {
"path": {
"description": "Path to output file",
"type": "string"
},
"type": {
"enum": ["file"],
"type": "string"
}
},
"type": "object"
},
"HecClientsConfigSchema": {
"properties": {
"default": {
"$ref": "#/definitions/HecConfigSchema",
"description": "Base settings that apply to all HEC clients. Overrides for events, metrics and\ninternal metrics will be layered on top of the defaults and allow for using\ndifferent HEC tokens, URL or destination index."
},
"events": {
"$ref": "#/definitions/Partial<HecConfigSchema>",
"description": "HEC settings (overrides for `default`) for events sent to Splunk"
},
"internal": {
"$ref": "#/definitions/Partial<HecConfigSchema>",
"description": "HEC settings (overrides for `default`) for internal metrics sent to Splunk"
},
"metrics": {
"$ref": "#/definitions/Partial<HecConfigSchema>",
"description": "HEC settings (overrides for `default`) for metrics sent to Splunk"
}
},
"type": "object"
},
"HecConfigSchema": {
"description": "Settings for the Splunk HTTP Event Collector client",
"properties": {
"defaultFields": {
"additionalProperties": {},
"description": "Default set of fields to apply to all events and metrics sent with this HEC client",
"type": "object"
},
"defaultMetadata": {
"description": "Defaults for host, source, sourcetype and index. Can be overridden for each message",
"properties": {
"host": {
"type": "string"
},
"index": {
"type": "string"
},
"source": {
"type": "string"
},
"sourcetype": {
"type": "string"
}
},
"type": "object"
},
"flushTime": {
"description": "Maximum number of milliseconds to wait before flushing the HEC message queue",
"type": ["string", "number"]
},
"gzip": {
"description": "Gzip compress the request body sent to HEC (Content-Encoding: gzip)",
"type": "boolean"
},
"maxQueueEntries": {
"description": "Maximum number of entries in the HEC message queue before flushing it",
"type": "number"
},
"maxQueueSize": {
"description": "Maximum number of bytes in the HEC message queue before flushing it",
"type": "number"
},
"maxRetries": {
"description": "Maximum number of attempts to send a batch to HEC. By default this there is no limit",
"type": "number"
},
"maxSockets": {
"description": "Maximum number of sockets HEC will use (per host)",
"type": "number"
},
"multipleMetricFormatEnabled": {
"description": "Enable sending multiple metrics in a single message to HEC.\nSupported as of Splunk 8.0.0\n\nhttps://docs.splunk.com/Documentation/Splunk/8.0.0/Metrics/GetMetricsInOther#The_multiple-metric_JSON_format",
"type": "boolean"
},
"requestKeepAlive": {
"description": "Set to `false` to disable HTTP keep-alive for connections to Splunk",
"type": "boolean"
},
"retryWaitTime": {
"anyOf": [
{
"$ref": "#/definitions/ExponentialBackoffConfig"
},
{
"$ref": "#/definitions/LinearBackoffConfig"
},
{
"type": ["string", "number"]
}
],
"description": "Wait time before retrying to send a (batch of) HEC messages after an error"
},
"timeout": {
"description": "Number of milliseconds to wait before considering an HTTP request as failed",
"type": ["string", "number"]
},
"token": {
"description": "The HEC token used to authenticate HTTP requests",
"type": "string"
},
"url": {
"description": "The URL of HEC. If only the base URL is specified (path is omitted) then the default path will be used",
"type": "string"
},
"userAgent": {
"default": "`fabriclogger-hec-client/<version>`",
"description": "User-agent header sent to HEC",
"type": "string"
},
"validateCertificate": {
"description": "If set to false, the HTTP client will ignore certificate errors (eg. when using self-signed certs)",
"type": "boolean"
},
"waitForAvailability": {
"description": "If set to > 0, then fabriclogger will wait for the HEC service to become available for the given amount of time\nby periodically attempting to request the collector/health REST endpoint. This can be useful when starting\nSplunk and fabriclogger for example in docker-compose, where Splunk takes some time to start.",
"type": ["string", "number"]
}
},
"type": "object"
},
"HecOutputConfig": {
"properties": {
"sourceTypePrefix": {
"description": "A common prefix for all unknown events emitted to Splunk",
"type": "string"
},
"sourcetypes": {
"$ref": "#/definitions/SourcetypesSchema",
"description": "Sourcetypes to use for different kinds of events we send to Splunk"
},
"type": {
"enum": ["hec"],
"type": "string"
}
},
"type": "object"
},
"LinearBackoffConfig": {
"description": "Linear increasing wait time",
"properties": {
"max": {
"description": "Maximum wait time",
"type": ["string", "number"]
},
"min": {
"description": "Minimum wait time (after the first failure)",
"type": ["string", "number"]
},
"step": {
"description": "Increase of wait time for each failure after the first until max is reached",
"type": ["string", "number"]
},
"type": {
"enum": ["linear-backoff"],
"type": "string"
}
},
"type": "object"
},
"Partial<HecConfigSchema>": {
"properties": {
"defaultFields": {
"additionalProperties": {},
"description": "Default set of fields to apply to all events and metrics sent with this HEC client",
"type": "object"
},
"defaultMetadata": {
"description": "Defaults for host, source, sourcetype and index. Can be overridden for each message",
"properties": {
"host": {
"type": "string"
},
"index": {
"type": "string"
},
"source": {
"type": "string"
},
"sourcetype": {
"type": "string"
}
},
"type": "object"
},
"flushTime": {
"description": "Maximum number of milliseconds to wait before flushing the HEC message queue",
"type": ["string", "number"]
},
"gzip": {
"description": "Gzip compress the request body sent to HEC (Content-Encoding: gzip)",
"type": "boolean"
},
"maxQueueEntries": {
"description": "Maximum number of entries in the HEC message queue before flushing it",
"type": "number"
},
"maxQueueSize": {
"description": "Maximum number of bytes in the HEC message queue before flushing it",
"type": "number"
},
"maxRetries": {
"description": "Maximum number of attempts to send a batch to HEC. By default this there is no limit",
"type": "number"
},
"maxSockets": {
"description": "Maximum number of sockets HEC will use (per host)",
"type": "number"
},
"multipleMetricFormatEnabled": {
"description": "Enable sending multiple metrics in a single message to HEC.\nSupported as of Splunk 8.0.0\n\nhttps://docs.splunk.com/Documentation/Splunk/8.0.0/Metrics/GetMetricsInOther#The_multiple-metric_JSON_format",
"type": "boolean"
},
"requestKeepAlive": {
"description": "Set to `false` to disable HTTP keep-alive for connections to Splunk",
"type": "boolean"
},
"retryWaitTime": {
"anyOf": [
{
"$ref": "#/definitions/ExponentialBackoffConfig"
},
{
"$ref": "#/definitions/LinearBackoffConfig"
},
{
"type": ["string", "number"]
}
],
"description": "Wait time before retrying to send a (batch of) HEC messages after an error"
},
"timeout": {
"description": "Number of milliseconds to wait before considering an HTTP request as failed",
"type": ["string", "number"]
},
"token": {
"description": "The HEC token used to authenticate HTTP requests",
"type": "string"
},
"url": {
"description": "The URL of HEC. If only the base URL is specified (path is omitted) then the default path will be used",
"type": "string"
},
"userAgent": {
"default": "`fabriclogger-hec-client/<version>`",
"description": "User-agent header sent to HEC",
"type": "string"
},
"validateCertificate": {
"description": "If set to false, the HTTP client will ignore certificate errors (eg. when using self-signed certs)",
"type": "boolean"
},
"waitForAvailability": {
"description": "If set to > 0, then fabriclogger will wait for the HEC service to become available for the given amount of time\nby periodically attempting to request the collector/health REST endpoint. This can be useful when starting\nSplunk and fabriclogger for example in docker-compose, where Splunk takes some time to start.",
"type": ["string", "number"]
}
},
"type": "object"
},
"PrometheusConfigSchema": {
"properties": {
"allowCompression": {
"description": "If not disabled, this will allow the prometheus server to respond with compressed body (gzip or deflate)",
"type": "boolean"
},
"discovery": {
"description": "Enable prometheus endpoint discovery.",
"type": "boolean"
},
"endpoints": {
"description": "Prometheus endpoints to scrape",
"items": {
"$ref": "#/definitions/PrometheusEndpointConfigSchema"
},
"type": "array"
},
"namePrefix": {
"description": "A common prefix for all Prometheus metrics emitted to Splunk",
"type": "string"
},
"ordererPath": {
"description": "Default path to try for discovered orderers (overrides path).",
"type": "string"
},
"ordererPort": {
"description": "Default port to try for discovered orderers (overrides port).",
"type": "string"
},
"path": {
"description": "URL path to use when scraping Prometheus metrics",
"type": "string"
},
"peerPath": {
"description": "Default path to try for discovered peers (overrides path).",
"type": "string"
},
"peerPort": {
"description": "Default port to try for discovered peers (overrides port).",
"type": "string"
},
"port": {
"description": "Port to use when scraping Prometheus metrics.",
"type": "string"
},
"protocol": {
"description": "Protocol to use when scraping Prometheus metrics",
"type": "string"
},
"scrapeInterval": {
"description": "Time between scrapes of Prometheus endpoints.",
"type": ["string", "number"]
},
"timeout": {
"description": "Request timeout",
"type": "number"
},
"userAgent": {
"description": "User-agent header sent to metrics endpoint",
"type": "string"
},
"validateCertificate": {
"description": "If set to false, the HTTP client will ignore certificate errors (eg. when using self-signed certs)",
"type": "boolean"
},
"validateContentType": {
"description": "If set to false, the scraper will not check the content type of the response from the server",
"type": "boolean"
}
},
"type": "object"
},
"PrometheusEndpointConfigSchema": {
"properties": {
"allowCompression": {
"description": "If not disabled, this will allow the prometheus server to respond with compressed body (gzip or deflate)",
"type": "boolean"
},
"path": {
"description": "URL path to use when scraping Prometheus metrics",
"type": "string"
},
"port": {
"description": "Port to use when scraping Prometheus metrics.",
"type": "string"
},
"protocol": {
"description": "Protocol to use when scraping Prometheus metrics",
"type": "string"
},
"scrapeInterval": {
"description": "Time between scrapes of Prometheus endpoints.",
"type": ["string", "number"]
},
"timeout": {
"description": "Request timeout",
"type": "number"
},
"url": {
"description": "Full URL to scrape for Prometheus metrics",
"type": "string"
},
"userAgent": {
"description": "User-agent header sent to metrics endpoint",
"type": "string"
},
"validateCertificate": {
"description": "If set to false, the HTTP client will ignore certificate errors (eg. when using self-signed certs)",
"type": "boolean"
},
"validateContentType": {
"description": "If set to false, the scraper will not check the content type of the response from the server",
"type": "boolean"
}
},
"type": "object"
},
"SourcetypesSchema": {
"description": "Configurable set of `sourcetype` field values emitted by fabriclogger",
"properties": {
"block": {
"default": "fabric_logger:block",
"type": "string"
},
"ccevent": {
"default": "fabric_logger:ccevent",
"type": "string"
},
"config": {
"default": "fabric_logger:config",
"type": "string"
},
"endorser_transaction": {
"default": "fabric_logger:endorser_transaction",
"type": "string"
},
"nodeMetrics": {
"default": "fabric:node:metrics",
"type": "string"
}
},
"type": "object"
}
},
"properties": {
"checkpoint": {
"$ref": "#/definitions/CheckpointConfigSchema",
"description": "Checkpoint configuration - how fabriclogger keeps track of state between restarts"
},
"fabric": {
"$ref": "#/definitions/FabricConfigSchema",
"description": "Fabric configuration"
},
"hec": {
"$ref": "#/definitions/HecClientsConfigSchema",
"description": "HTTP event collector"
},
"output": {
"anyOf": [
{
"$ref": "#/definitions/HecOutputConfig"
},
{
"$ref": "#/definitions/ConsoleOutputConfig"
},
{
"$ref": "#/definitions/FileOutputConfig"
},
{
"$ref": "#/definitions/DevNullOutputConfig"
}
],
"description": "In the output configuration you can specify where fabriclogger will send generated\nevents to. By default it will send all information to Splunk HEC,\nbut you can instead send it to console output or a file."
},
"prometheus": {
"$ref": "#/definitions/PrometheusConfigSchema",
"description": "Prometheus Scraper Configuration"
}
},
"type": "object"
}