Skip to content

Commit e94fb0c

Browse files
paomianfengjiachun
andauthored
chore: add doc for pipeline skip error (#1918)
Co-authored-by: jeremyhi <[email protected]>
1 parent 5205459 commit e94fb0c

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

docs/user-guide/logs/write-logs.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,3 +270,16 @@ Please refer to the "Writing Logs" section in the [Quick Start](quick-start.md#w
270270

271271
By default, logs table created by HTTP ingestion API are in [append only
272272
mode](/user-guide/deployments-administration/performance-tuning/design-table.md#when-to-use-append-only-tables).
273+
274+
## Skip Errors with skip_error
275+
276+
If you want to skip errors when writing logs, you can add the `skip_error` parameter to the HTTP request's query params. For example:
277+
278+
```shell
279+
curl -X "POST" "http://localhost:4000/v1/events/logs?db=<db-name>&table=<table-name>&pipeline_name=<pipeline-name>&version=<pipeline-version>&skip_error=true" \
280+
-H "Content-Type: application/x-ndjson" \
281+
-H "Authorization: Basic {{authentication}}" \
282+
-d "$<log-items>"
283+
```
284+
285+
With this, GreptimeDB will skip the log entry when an error is encountered and continue processing the remaining logs. The entire request will not fail due to an error in a single log entry.

i18n/zh/docusaurus-plugin-content-docs/current/user-guide/logs/write-logs.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,3 +268,17 @@ processors:
268268
## Append 模式
269269

270270
通过此接口创建的日志表,默认为[Append 模式](/user-guide/deployments-administration/performance-tuning/design-table.md#何时使用-append-only-表).
271+
272+
273+
## 使用 skip_error 跳过错误
274+
275+
如果你希望在写入日志时跳过错误,可以在 HTTP 请求的 query params 中添加 `skip_error` 参数。比如:
276+
277+
```shell
278+
curl -X "POST" "http://localhost:4000/v1/events/logs?db=<db-name>&table=<table-name>&pipeline_name=<pipeline-name>&version=<pipeline-version>&skip_error=true" \
279+
-H "Content-Type: application/x-ndjson" \
280+
-H "Authorization: Basic {{authentication}}" \
281+
-d "$<log-items>"
282+
```
283+
284+
这样,GreptimeDB 将在遇到错误时跳过该条日志,并继续处理其他日志。不会因为某一条日志的错误而导致整个请求失败。

0 commit comments

Comments
 (0)