Skip to content

Commit 24aef8c

Browse files
github-actions[bot]daniil-quix
andauthored
Update documentation (#714)
Co-authored-by: daniil-quix <[email protected]>
1 parent 833275f commit 24aef8c

File tree

2 files changed

+52
-30
lines changed

2 files changed

+52
-30
lines changed

docs/api-reference/quixstreams.md

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3231,7 +3231,7 @@ Remove partition from the list of paused TPs if it's revoked
32313231
class InfluxDB3Sink(BatchingSink)
32323232
```
32333233

3234-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/sinks/core/influxdb3.py#L23)
3234+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/sinks/core/influxdb3.py#L38)
32353235

32363236
<a id="quixstreams.sinks.core.influxdb3.InfluxDB3Sink.__init__"></a>
32373237

@@ -3242,19 +3242,20 @@ def __init__(token: str,
32423242
host: str,
32433243
organization_id: str,
32443244
database: str,
3245-
measurement: str,
3246-
fields_keys: Iterable[str] = (),
3247-
tags_keys: Iterable[str] = (),
3245+
measurement: MeasurementSetter,
3246+
fields_keys: FieldsSetter = (),
3247+
tags_keys: TagsSetter = (),
32483248
time_key: Optional[str] = None,
3249-
time_precision: WritePrecision = WritePrecision.MS,
3249+
time_precision: TimePrecision = "ms",
3250+
allow_missing_fields: bool = False,
32503251
include_metadata_tags: bool = False,
32513252
batch_size: int = 1000,
32523253
enable_gzip: bool = True,
32533254
request_timeout_ms: int = 10_000,
32543255
debug: bool = False)
32553256
```
32563257

3257-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/sinks/core/influxdb3.py#L24)
3258+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/sinks/core/influxdb3.py#L46)
32583259

32593260
A connector to sink processed data to InfluxDB v3.
32603261

@@ -3277,24 +3278,34 @@ from the backpressured topic partition until the "retry_after" timeout elapses.
32773278
- `host`: InfluxDB host in format "https://<host>"
32783279
- `organization_id`: InfluxDB organization_id
32793280
- `database`: database name
3280-
- `fields_keys`: a list of keys to be used as "fields" when writing to InfluxDB.
3281-
If present, it must not overlap with "tags_keys".
3282-
If empty, the whole record value will be used.
3281+
- `measurement`: measurement name as a string.
3282+
Also accepts a single-argument callable that receives the current message
3283+
data as a dict and returns a string.
3284+
- `fields_keys`: an iterable (list) of strings used as InfluxDB "fields".
3285+
Also accepts a single-argument callable that receives the current message
3286+
data as a dict and returns an iterable of strings.
3287+
- If present, it must not overlap with "tags_keys".
3288+
- If empty, the whole record value will be used.
32833289
>***NOTE*** The fields' values can only be strings, floats, integers, or booleans.
32843290
Default - `()`.
3285-
- `tags_keys`: a list of keys to be used as "tags" when writing to InfluxDB.
3286-
If present, it must not overlap with "fields_keys".
3287-
These keys will be popped from the value dictionary
3288-
automatically because InfluxDB doesn't allow the same keys be
3289-
both in tags and fields.
3290-
If empty, no tags will be sent.
3291+
- `tags_keys`: an iterable (list) of strings used as InfluxDB "tags".
3292+
Also accepts a single-argument callable that receives the current message
3293+
data as a dict and returns an iterable of strings.
3294+
- If present, it must not overlap with "fields_keys".
3295+
- Given keys are popped from the value dictionary since the same key
3296+
cannot be both a tag and field.
3297+
- If empty, no tags will be sent.
32913298
>***NOTE***: InfluxDB client always converts tag values to strings.
32923299
Default - `()`.
32933300
- `time_key`: a key to be used as "time" when writing to InfluxDB.
32943301
By default, the record timestamp will be used with "ms" time precision.
32953302
When using a custom key, you may need to adjust the `time_precision` setting
32963303
to match.
32973304
- `time_precision`: a time precision to use when writing to InfluxDB.
3305+
Possible values: "ms", "ns", "us", "s".
3306+
Default - `"ms"`.
3307+
- `allow_missing_fields`: if `True`, skip the missing fields keys, else raise `KeyError`.
3308+
Default - `False`
32983309
- `include_metadata_tags`: if True, includes record's key, topic,
32993310
and partition as tags.
33003311
Default - `False`.

docs/api-reference/sinks.md

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ a timeout specified in `retry_after`, and resume it when it's elapsed.
242242
class InfluxDB3Sink(BatchingSink)
243243
```
244244

245-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/sinks/core/influxdb3.py#L23)
245+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/sinks/core/influxdb3.py#L38)
246246

247247
<a id="quixstreams.sinks.core.influxdb3.InfluxDB3Sink.__init__"></a>
248248

@@ -255,19 +255,20 @@ def __init__(token: str,
255255
host: str,
256256
organization_id: str,
257257
database: str,
258-
measurement: str,
259-
fields_keys: Iterable[str] = (),
260-
tags_keys: Iterable[str] = (),
258+
measurement: MeasurementSetter,
259+
fields_keys: FieldsSetter = (),
260+
tags_keys: TagsSetter = (),
261261
time_key: Optional[str] = None,
262-
time_precision: WritePrecision = WritePrecision.MS,
262+
time_precision: TimePrecision = "ms",
263+
allow_missing_fields: bool = False,
263264
include_metadata_tags: bool = False,
264265
batch_size: int = 1000,
265266
enable_gzip: bool = True,
266267
request_timeout_ms: int = 10_000,
267268
debug: bool = False)
268269
```
269270

270-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/sinks/core/influxdb3.py#L24)
271+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/sinks/core/influxdb3.py#L46)
271272

272273
A connector to sink processed data to InfluxDB v3.
273274

@@ -292,24 +293,34 @@ from the backpressured topic partition until the "retry_after" timeout elapses.
292293
- `host`: InfluxDB host in format "https://<host>"
293294
- `organization_id`: InfluxDB organization_id
294295
- `database`: database name
295-
- `fields_keys`: a list of keys to be used as "fields" when writing to InfluxDB.
296-
If present, it must not overlap with "tags_keys".
297-
If empty, the whole record value will be used.
296+
- `measurement`: measurement name as a string.
297+
Also accepts a single-argument callable that receives the current message
298+
data as a dict and returns a string.
299+
- `fields_keys`: an iterable (list) of strings used as InfluxDB "fields".
300+
Also accepts a single-argument callable that receives the current message
301+
data as a dict and returns an iterable of strings.
302+
- If present, it must not overlap with "tags_keys".
303+
- If empty, the whole record value will be used.
298304
>***NOTE*** The fields' values can only be strings, floats, integers, or booleans.
299305
Default - `()`.
300-
- `tags_keys`: a list of keys to be used as "tags" when writing to InfluxDB.
301-
If present, it must not overlap with "fields_keys".
302-
These keys will be popped from the value dictionary
303-
automatically because InfluxDB doesn't allow the same keys be
304-
both in tags and fields.
305-
If empty, no tags will be sent.
306+
- `tags_keys`: an iterable (list) of strings used as InfluxDB "tags".
307+
Also accepts a single-argument callable that receives the current message
308+
data as a dict and returns an iterable of strings.
309+
- If present, it must not overlap with "fields_keys".
310+
- Given keys are popped from the value dictionary since the same key
311+
cannot be both a tag and field.
312+
- If empty, no tags will be sent.
306313
>***NOTE***: InfluxDB client always converts tag values to strings.
307314
Default - `()`.
308315
- `time_key`: a key to be used as "time" when writing to InfluxDB.
309316
By default, the record timestamp will be used with "ms" time precision.
310317
When using a custom key, you may need to adjust the `time_precision` setting
311318
to match.
312319
- `time_precision`: a time precision to use when writing to InfluxDB.
320+
Possible values: "ms", "ns", "us", "s".
321+
Default - `"ms"`.
322+
- `allow_missing_fields`: if `True`, skip the missing fields keys, else raise `KeyError`.
323+
Default - `False`
313324
- `include_metadata_tags`: if True, includes record's key, topic,
314325
and partition as tags.
315326
Default - `False`.

0 commit comments

Comments
 (0)