-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Copy pathclickhouse.cue
437 lines (395 loc) · 13.4 KB
/
clickhouse.cue
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
package metadata
base: components: sinks: clickhouse: 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 connected to that sink, where the source supports
end-to-end acknowledgements as well, waits for events to be acknowledged by the sink
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: {}
}
}
auth: {
description: """
Configuration of the authentication strategy for HTTP requests.
HTTP authentication should be used with HTTPS only, as the authentication credentials are passed as an
HTTP header without any additional encryption beyond what is provided by the transport itself.
"""
required: false
type: object: options: {
password: {
description: "The basic authentication password."
relevant_when: "strategy = \"basic\""
required: true
type: string: examples: ["${PASSWORD}", "password"]
}
strategy: {
description: "The authentication strategy to use."
required: true
type: string: enum: {
basic: """
Basic authentication.
The username and password are concatenated and encoded via [base64][base64].
[base64]: https://en.wikipedia.org/wiki/Base64
"""
bearer: """
Bearer authentication.
The bearer token value (OAuth2, JWT, etc.) is passed as-is.
"""
}
}
token: {
description: "The bearer authentication token."
relevant_when: "strategy = \"bearer\""
required: true
type: string: {}
}
user: {
description: "The basic authentication username."
relevant_when: "strategy = \"basic\""
required: true
type: string: examples: ["${USERNAME}", "username"]
}
}
}
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/compressed.
"""
required: false
type: uint: {
default: 10000000
unit: "bytes"
}
}
max_events: {
description: "The maximum size of a batch before it is flushed."
required: false
type: uint: unit: "events"
}
timeout_secs: {
description: "The maximum age of a batch before it is flushed."
required: false
type: float: {
default: 1.0
unit: "seconds"
}
}
}
}
compression: {
description: """
Compression configuration.
All compression algorithms use the default compression level unless otherwise specified.
"""
required: false
type: string: {
default: "gzip"
enum: {
gzip: """
[Gzip][gzip] compression.
[gzip]: https://www.gzip.org/
"""
none: "No compression."
zlib: """
[Zlib][zlib] compression.
[zlib]: https://zlib.net/
"""
zstd: """
[Zstandard][zstd] compression.
[zstd]: https://facebook.github.io/zstd/
"""
}
}
}
database: {
description: "The database that contains the table that data is inserted into."
required: false
type: string: {
examples: ["mydatabase"]
syntax: "template"
}
}
date_time_best_effort: {
description: "Sets `date_time_input_format` to `best_effort`, allowing ClickHouse to properly parse RFC3339/ISO 8601."
required: false
type: bool: default: false
}
encoding: {
description: "Transformations to prepare an event for serialization."
required: false
type: object: options: {
except_fields: {
description: "List of fields that are excluded from the encoded event."
required: false
type: array: items: type: string: {}
}
only_fields: {
description: "List of fields that are included in the encoded event."
required: false
type: array: items: type: string: {}
}
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."
}
}
}
}
endpoint: {
description: "The endpoint of the ClickHouse server."
required: true
type: string: examples: ["http://localhost:8123"]
}
request: {
description: """
Middleware settings for outbound requests.
Various settings can be configured, such as concurrency and rate limits, timeouts, etc.
"""
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 that 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 will be 1 (no concurrency).
It is recommended to set 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
}
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 uint, which denotes
a fixed concurrency limit.
"""
required: false
type: {
string: {
default: "adaptive"
enum: {
adaptive: """
Concurrency will be 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.
The default, for all intents and purposes, represents an infinite number of retries.
"""
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_max_duration_secs: {
description: "The maximum amount of time to wait between retries."
required: false
type: uint: {
default: 3600
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"
}
}
}
}
skip_unknown_fields: {
description: "Sets `input_format_skip_unknown_fields`, allowing ClickHouse to discard fields not present in the table schema."
required: false
type: bool: default: false
}
table: {
description: "The table that data is inserted into."
required: true
type: string: {
examples: ["mytable"]
syntax: "template"
}
}
tls: {
description: "TLS configuration."
required: false
type: object: options: {
alpn_protocols: {
description: """
Sets the list of supported ALPN protocols.
Declare the supported ALPN protocols, which are used during negotiation with peer. They are prioritized in the order
that they are defined.
"""
required: false
type: array: items: type: string: examples: ["h2"]
}
ca_file: {
description: """
Absolute path to an additional CA certificate file.
The certificate must be in the DER or PEM (X.509) format. Additionally, the certificate can be provided as an inline string in PEM format.
"""
required: false
type: string: examples: ["/path/to/certificate_authority.crt"]
}
crt_file: {
description: """
Absolute path to a certificate file used to identify this server.
The certificate must be in DER, PEM (X.509), or PKCS#12 format. Additionally, the certificate can be provided as
an inline string in PEM format.
If this is set, and is not a PKCS#12 archive, `key_file` must also be set.
"""
required: false
type: string: examples: ["/path/to/host_certificate.crt"]
}
key_file: {
description: """
Absolute path to a private key file used to identify this server.
The key must be in DER or PEM (PKCS#8) format. Additionally, the key can be provided as an inline string in PEM format.
"""
required: false
type: string: examples: ["/path/to/host_certificate.key"]
}
key_pass: {
description: """
Passphrase used to unlock the encrypted key file.
This has no effect unless `key_file` is set.
"""
required: false
type: string: examples: ["${KEY_PASS_ENV_VAR}", "PassWord1"]
}
verify_certificate: {
description: """
Enables certificate verification.
If enabled, certificates must not be expired and must be issued by a trusted
issuer. This verification operates in a hierarchical manner, checking that the leaf certificate (the
certificate presented by the client/server) is not only valid, but that the issuer of that certificate is also valid, and
so on until the verification process reaches a root certificate.
Relevant for both incoming and outgoing connections.
Do NOT set this to `false` unless you understand the risks of not verifying the validity of certificates.
"""
required: false
type: bool: {}
}
verify_hostname: {
description: """
Enables hostname verification.
If enabled, the hostname used to connect to the remote host must be present in the TLS certificate presented by
the remote host, either as the Common Name or as an entry in the Subject Alternative Name extension.
Only relevant for outgoing connections.
Do NOT set this to `false` unless you understand the risks of not verifying the remote hostname.
"""
required: false
type: bool: {}
}
}
}
}