forked from vectordotdev/vector
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathredis.cue
More file actions
653 lines (594 loc) · 21.8 KB
/
redis.cue
File metadata and controls
653 lines (594 loc) · 21.8 KB
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
package metadata
base: components: sinks: redis: configuration: {
acknowledgements: {
description: """
Controls how acknowledgements are handled for this sink.
See [End-to-end Acknowledgements][e2e_acks] for more information on how event acknowledgement is handled.
[e2e_acks]: https://vector.dev/docs/about/under-the-hood/architecture/end-to-end-acknowledgements/
"""
required: false
type: object: options: enabled: {
description: """
Whether or not end-to-end acknowledgements are enabled.
When enabled for a sink, any source that supports end-to-end
acknowledgements that is connected to that sink waits for events
to be acknowledged by **all connected sinks** before acknowledging them at the source.
Enabling or disabling acknowledgements at the sink level takes precedence over any global
[`acknowledgements`][global_acks] configuration.
[global_acks]: https://vector.dev/docs/reference/configuration/global-options/#acknowledgements
"""
required: false
type: bool: {}
}
}
batch: {
description: "Event batching behavior."
required: false
type: object: options: {
max_bytes: {
description: """
The maximum size of a batch that is processed by a sink.
This is based on the uncompressed size of the batched events, before they are
serialized or compressed.
"""
required: false
type: uint: unit: "bytes"
}
max_events: {
description: "The maximum size of a batch before it is flushed."
required: false
type: uint: {
default: 1
unit: "events"
}
}
timeout_secs: {
description: "The maximum age of a batch before it is flushed."
required: false
type: float: {
default: 1.0
unit: "seconds"
}
}
}
}
data_type: {
description: "Redis data type to store messages in."
required: false
type: string: {
default: "list"
enum: {
channel: """
The Redis `channel` type.
Redis channels function in a pub/sub fashion, allowing many-to-many broadcasting and receiving.
"""
list: """
The Redis `list` type.
This resembles a deque, where messages can be popped and pushed from either end.
This is the default.
"""
}
}
}
encoding: {
description: "Configures how events are encoded into raw bytes."
required: true
type: object: options: {
avro: {
description: "Apache Avro-specific encoder options."
relevant_when: "codec = \"avro\""
required: true
type: object: options: schema: {
description: "The Avro schema."
required: true
type: string: examples: ["{ \"type\": \"record\", \"name\": \"log\", \"fields\": [{ \"name\": \"message\", \"type\": \"string\" }] }"]
}
}
cef: {
description: "The CEF Serializer Options."
relevant_when: "codec = \"cef\""
required: true
type: object: options: {
device_event_class_id: {
description: """
Unique identifier for each event type. Identifies the type of event reported.
The value length must be less than or equal to 1023.
"""
required: true
type: string: {}
}
device_product: {
description: """
Identifies the product of a vendor.
The part of a unique device identifier. No two products can use the same combination of device vendor and device product.
The value length must be less than or equal to 63.
"""
required: true
type: string: {}
}
device_vendor: {
description: """
Identifies the vendor of the product.
The part of a unique device identifier. No two products can use the same combination of device vendor and device product.
The value length must be less than or equal to 63.
"""
required: true
type: string: {}
}
device_version: {
description: """
Identifies the version of the problem. The combination of the device product, vendor and this value make up the unique id of the device that sends messages.
The value length must be less than or equal to 31.
"""
required: true
type: string: {}
}
extensions: {
description: """
The collection of key-value pairs. Keys are the keys of the extensions, and values are paths that point to the extension values of a log event.
The event can have any number of key-value pairs in any order.
"""
required: false
type: object: options: "*": {
description: "This is a path that points to the extension value of a log event."
required: true
type: string: {}
}
}
name: {
description: """
This is a path that points to the human-readable description of a log event.
The value length must be less than or equal to 512.
Equals "cef.name" by default.
"""
required: true
type: string: {}
}
severity: {
description: """
This is a path that points to the field of a log event that reflects importance of the event.
Reflects importance of the event.
It must point to a number from 0 to 10.
0 = lowest_importance, 10 = highest_importance.
Set to "cef.severity" by default.
"""
required: true
type: string: {}
}
version: {
description: """
CEF Version. Can be either 0 or 1.
Set to "0" by default.
"""
required: true
type: string: enum: {
V0: "CEF specification version 0.1."
V1: "CEF specification version 1.x."
}
}
}
}
codec: {
description: "The codec to use for encoding events."
required: true
type: string: enum: {
avro: """
Encodes an event as an [Apache Avro][apache_avro] message.
[apache_avro]: https://avro.apache.org/
"""
cef: "Encodes an event as a CEF (Common Event Format) formatted message."
csv: """
Encodes an event as a CSV message.
This codec must be configured with fields to encode.
"""
gelf: """
Encodes an event as a [GELF][gelf] message.
This codec is experimental for the following reason:
The GELF specification is more strict than the actual Graylog receiver.
Vector's encoder currently adheres more strictly to the GELF spec, with
the exception that some characters such as `@` are allowed in field names.
Other GELF codecs, such as Loki's, use a [Go SDK][implementation] that is maintained
by Graylog and is much more relaxed than the GELF spec.
Going forward, Vector will use that [Go SDK][implementation] as the reference implementation, which means
the codec might continue to relax the enforcement of the specification.
[gelf]: https://docs.graylog.org/docs/gelf
[implementation]: https://github.com/Graylog2/go-gelf/blob/v2/gelf/reader.go
"""
json: """
Encodes an event as [JSON][json].
[json]: https://www.json.org/
"""
logfmt: """
Encodes an event as a [logfmt][logfmt] message.
[logfmt]: https://brandur.org/logfmt
"""
native: """
Encodes an event in the [native Protocol Buffers format][vector_native_protobuf].
This codec is **[experimental][experimental]**.
[vector_native_protobuf]: https://github.com/vectordotdev/vector/blob/master/lib/vector-core/proto/event.proto
[experimental]: https://vector.dev/highlights/2022-03-31-native-event-codecs
"""
native_json: """
Encodes an event in the [native JSON format][vector_native_json].
This codec is **[experimental][experimental]**.
[vector_native_json]: https://github.com/vectordotdev/vector/blob/master/lib/codecs/tests/data/native_encoding/schema.cue
[experimental]: https://vector.dev/highlights/2022-03-31-native-event-codecs
"""
protobuf: """
Encodes an event as a [Protobuf][protobuf] message.
[protobuf]: https://protobuf.dev/
"""
raw_message: """
No encoding.
This encoding uses the `message` field of a log event.
Be careful if you are modifying your log events (for example, by using a `remap`
transform) and removing the message field while doing additional parsing on it, as this
could lead to the encoding emitting empty strings for the given event.
"""
text: """
Plain text encoding.
This encoding uses the `message` field of a log event. For metrics, it uses an
encoding that resembles the Prometheus export format.
Be careful if you are modifying your log events (for example, by using a `remap`
transform) and removing the message field while doing additional parsing on it, as this
could lead to the encoding emitting empty strings for the given event.
"""
}
}
csv: {
description: "The CSV Serializer Options."
relevant_when: "codec = \"csv\""
required: true
type: object: options: {
capacity: {
description: """
Sets the capacity (in bytes) of the internal buffer used in the CSV writer.
This defaults to 8KB.
"""
required: false
type: uint: default: 8192
}
delimiter: {
description: "The field delimiter to use when writing CSV."
required: false
type: ascii_char: default: ","
}
double_quote: {
description: """
Enables double quote escapes.
This is enabled by default, but you can disable it. When disabled, quotes in
field data are escaped instead of doubled.
"""
required: false
type: bool: default: true
}
escape: {
description: """
The escape character to use when writing CSV.
In some variants of CSV, quotes are escaped using a special escape character
like \\ (instead of escaping quotes by doubling them).
To use this, `double_quotes` needs to be disabled as well; otherwise, this setting is ignored.
"""
required: false
type: ascii_char: default: "\""
}
fields: {
description: """
Configures the fields that are encoded, as well as the order in which they
appear in the output.
If a field is not present in the event, the output for that field is an empty string.
Values of type `Array`, `Object`, and `Regex` are not supported, and the
output for any of these types is an empty string.
"""
required: true
type: array: items: type: string: {}
}
quote: {
description: "The quote character to use when writing CSV."
required: false
type: ascii_char: default: "\""
}
quote_style: {
description: "The quoting style to use when writing CSV data."
required: false
type: string: {
default: "necessary"
enum: {
always: "Always puts quotes around every field."
necessary: """
Puts quotes around fields only when necessary.
They are necessary when fields contain a quote, delimiter, or record terminator.
Quotes are also necessary when writing an empty record
(which is indistinguishable from a record with one empty field).
"""
never: "Never writes quotes, even if it produces invalid CSV data."
non_numeric: """
Puts quotes around all fields that are non-numeric.
This means that when writing a field that does not parse as a valid float or integer,
quotes are used even if they aren't strictly necessary.
"""
}
}
}
}
}
except_fields: {
description: "List of fields that are excluded from the encoded event."
required: false
type: array: items: type: string: {}
}
json: {
description: "Options for the JsonSerializer."
relevant_when: "codec = \"json\""
required: false
type: object: options: pretty: {
description: "Whether to use pretty JSON formatting."
required: false
type: bool: default: false
}
}
metric_tag_values: {
description: """
Controls how metric tag values are encoded.
When set to `single`, only the last non-bare value of tags are displayed with the
metric. When set to `full`, all metric tags are exposed as separate assignments.
"""
relevant_when: "codec = \"json\" or codec = \"text\""
required: false
type: string: {
default: "single"
enum: {
full: "All tags are exposed as arrays of either string or null values."
single: """
Tag values are exposed as single strings, the same as they were before this config
option. Tags with multiple values show the last assigned value, and null values
are ignored.
"""
}
}
}
only_fields: {
description: "List of fields that are included in the encoded event."
required: false
type: array: items: type: string: {}
}
protobuf: {
description: "Options for the Protobuf serializer."
relevant_when: "codec = \"protobuf\""
required: true
type: object: options: {
desc_file: {
description: """
The path to the protobuf descriptor set file.
This file is the output of `protoc -I <include path> -o <desc output path> <proto>`
You can read more [here](https://buf.build/docs/reference/images/#how-buf-images-work).
"""
required: true
type: string: examples: ["/etc/vector/protobuf_descriptor_set.desc"]
}
message_type: {
description: "The name of the message type to use for serializing."
required: true
type: string: examples: ["package.Message"]
}
}
}
timestamp_format: {
description: "Format used for timestamp fields."
required: false
type: string: enum: {
rfc3339: "Represent the timestamp as a RFC 3339 timestamp."
unix: "Represent the timestamp as a Unix timestamp."
unix_float: "Represent the timestamp as a Unix timestamp in floating point."
unix_ms: "Represent the timestamp as a Unix timestamp in milliseconds."
unix_ns: "Represent the timestamp as a Unix timestamp in nanoseconds."
unix_us: "Represent the timestamp as a Unix timestamp in microseconds"
}
}
}
}
endpoint: {
description: """
The URL of the Redis endpoint to connect to.
The URL _must_ take the form of `protocol://server:port/db` where the protocol can either be
`redis` or `rediss` for connections secured via TLS.
"""
required: true
type: string: examples: ["redis://127.0.0.1:6379/0"]
}
key: {
description: "The Redis key to publish messages to."
required: true
type: string: {
examples: ["syslog:{{ app }}", "vector"]
syntax: "template"
}
}
list_option: {
description: "List-specific options."
required: false
type: object: options: method: {
description: "The method to use for pushing messages into a `list`."
required: true
type: string: enum: {
lpush: """
Use the `lpush` method.
This pushes messages onto the head of the list.
"""
rpush: """
Use the `rpush` method.
This pushes messages onto the tail of the list.
This is the default.
"""
}
}
}
request: {
description: """
Middleware settings for outbound requests.
Various settings can be configured, such as concurrency and rate limits, timeouts, and retry behavior.
Note that the retry backoff policy follows the Fibonacci sequence.
"""
required: false
type: object: options: {
adaptive_concurrency: {
description: """
Configuration of adaptive concurrency parameters.
These parameters typically do not require changes from the default, and incorrect values can lead to meta-stable or
unstable performance and sink behavior. Proceed with caution.
"""
required: false
type: object: options: {
decrease_ratio: {
description: """
The fraction of the current value to set the new concurrency limit when decreasing the limit.
Valid values are greater than `0` and less than `1`. Smaller values cause the algorithm to scale back rapidly
when latency increases.
**Note**: The new limit is rounded down after applying this ratio.
"""
required: false
type: float: default: 0.9
}
ewma_alpha: {
description: """
The weighting of new measurements compared to older measurements.
Valid values are greater than `0` and less than `1`.
ARC uses an exponentially weighted moving average (EWMA) of past RTT measurements as a reference to compare with
the current RTT. Smaller values cause this reference to adjust more slowly, which may be useful if a service has
unusually high response variability.
"""
required: false
type: float: default: 0.4
}
initial_concurrency: {
description: """
The initial concurrency limit to use. If not specified, the initial limit is 1 (no concurrency).
Datadog recommends setting this value to your service's average limit if you're seeing that it takes a
long time to ramp up adaptive concurrency after a restart. You can find this value by looking at the
`adaptive_concurrency_limit` metric.
"""
required: false
type: uint: default: 1
}
max_concurrency_limit: {
description: """
The maximum concurrency limit.
The adaptive request concurrency limit does not go above this bound. This is put in place as a safeguard.
"""
required: false
type: uint: default: 200
}
rtt_deviation_scale: {
description: """
Scale of RTT deviations which are not considered anomalous.
Valid values are greater than or equal to `0`, and we expect reasonable values to range from `1.0` to `3.0`.
When calculating the past RTT average, we also compute a secondary “deviation” value that indicates how variable
those values are. We use that deviation when comparing the past RTT average to the current measurements, so we
can ignore increases in RTT that are within an expected range. This factor is used to scale up the deviation to
an appropriate range. Larger values cause the algorithm to ignore larger increases in the RTT.
"""
required: false
type: float: default: 2.5
}
}
}
concurrency: {
description: """
Configuration for outbound request concurrency.
This can be set either to one of the below enum values or to a positive integer, which denotes
a fixed concurrency limit.
"""
required: false
type: {
string: {
default: "none"
enum: {
adaptive: """
Concurrency is managed by Vector's [Adaptive Request Concurrency][arc] feature.
[arc]: https://vector.dev/docs/about/under-the-hood/networking/arc/
"""
none: """
A fixed concurrency of 1.
Only one request can be outstanding at any given time.
"""
}
}
uint: {}
}
}
rate_limit_duration_secs: {
description: "The time window used for the `rate_limit_num` option."
required: false
type: uint: {
default: 1
unit: "seconds"
}
}
rate_limit_num: {
description: "The maximum number of requests allowed within the `rate_limit_duration_secs` time window."
required: false
type: uint: {
default: 9223372036854775807
unit: "requests"
}
}
retry_attempts: {
description: "The maximum number of retries to make for failed requests."
required: false
type: uint: {
default: 9223372036854775807
unit: "retries"
}
}
retry_initial_backoff_secs: {
description: """
The amount of time to wait before attempting the first retry for a failed request.
After the first retry has failed, the fibonacci sequence is used to select future backoffs.
"""
required: false
type: uint: {
default: 1
unit: "seconds"
}
}
retry_jitter_mode: {
description: "The jitter mode to use for retry backoff behavior."
required: false
type: string: {
default: "Full"
enum: {
Full: """
Full jitter.
The random delay is anywhere from 0 up to the maximum current delay calculated by the backoff
strategy.
Incorporating full jitter into your backoff strategy can greatly reduce the likelihood
of creating accidental denial of service (DoS) conditions against your own systems when
many clients are recovering from a failure state.
"""
None: "No jitter."
}
}
}
retry_max_duration_secs: {
description: "The maximum amount of time to wait between retries."
required: false
type: uint: {
default: 30
unit: "seconds"
}
}
timeout_secs: {
description: """
The time a request can take before being aborted.
Datadog highly recommends that you do not lower this value below the service's internal timeout, as this could
create orphaned requests, pile on retries, and result in duplicate data downstream.
"""
required: false
type: uint: {
default: 60
unit: "seconds"
}
}
}
}
}