Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/admin-manual/audit-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ The audit log table is a dynamically partitioned table, partitioned daily by def

In `fe.conf`, `LOG_DIR` defines the storage path for FE logs. All database operations executed by this FE node are recorded in `${LOG_DIR}/fe.audit.log`. To view all operations in the cluster, you need to traverse the audit logs of each FE node.

## Audit Log Format

In versions before 3.0.7, the symbols `\n`, `\t`, and `\r` in statements would be replaced with `\\n`, `\\t`, and `\\r`. These modified statements were then stored in the `fe.audit.log` file and the `audit_log` table.

Starting from version 3.0.7, for the `fe.audit.log` file, only `\n` in statements will be replaced with `\\n`. The `audit_log` table, stores the original format of statements.

## Audit Log Configuration

**Global Variables:**
Expand Down
40 changes: 40 additions & 0 deletions docs/admin-manual/open-api/fe-http/query-profile-action.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ under the License.

`GET /rest/v2/manager/query/kill/{query_id}`

`GET /rest/v2/manager/query/statistics/{trace_id}` (4.0.0+)

## Get the query information

`GET /rest/v2/manager/query/query_info`
Expand Down Expand Up @@ -499,3 +501,41 @@ Cancel query of specified connection.
"count": 0
}
```

## Get Query Progress by Trace ID

`GET /rest/v2/manager/query/statistics/{trace_id}` (4.0.0+)

### Description

Retrieve the statistics of a currently running query by Trace ID. You can call this API periodically to obtain the progress of the query.

### Path parameters

* `{trace_id}`

Trace ID. The user-defined Trace ID set via `SET session_context="trace_id:xxxx"`.

### Response

```json
{
"msg": "success",
"code": 0,
"data": {
"scanRows": 1234567,
"scanBytes": 987654321,
"returnedRows": 12345,
"cpuMs": 15600,
"maxPeakMemoryBytes": 536870912,
"currentUsedMemoryBytes": 268435456,
"shuffleSendBytes": 104857600,
"shuffleSendRows": 50000,
"scanBytesFromLocalStorage": 734003200,
"scanBytesFromRemoteStorage": 253651121,
"spillWriteBytesToLocalStorage": 0,
"spillReadBytesFromLocalStorage": 0
},
"count": 0
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,13 @@ Doris 提供了对于数据库操作的审计能力,可以记录用户对数

## 审计日志文件

在 fe.conf 中,LOG\_DIR 定义了 FE 日志的存储路径。在 ${LOG\_DIR}/fe.audit.log 中记录了这台 FE 节点执行的所有数据库操作。如果需要查看集群所有的操作,需要便利每一台 FE 的审计日志。
在 fe.conf 中,`LOG_DIR` 定义了 FE 日志的存储路径。在 `${LOG_DIR}/fe.audit.log` 中记录了这台 FE 节点执行的所有数据库操作。如果需要查看集群所有的操作,需要遍历每一台 FE 的审计日志。

## 审计日志格式

在 3.0.7 之前的版本的版本中,用户执行语句中的 `\n`, `\t`, `\r` 符号会把替换成 `\\n`, `\\t`, `\\r`。之后存储在 `fe.audit.log` 日志和 `audit_log` 表中。

3.0.7 开始,对于 `fe.audit.log` 日志,用户执行语句中仅 `\n` 会被替换成 `\\n`。而 `audit_log` 表存储的是原始的语句格式。

## 审计日志相关配置

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ under the License.

`GET /rest/v2/manager/query/kill/{query_id}`

`GET /rest/v2/manager/query/statistics/{trace_id}` (4.0.0+)

## 获取查询信息

`GET /rest/v2/manager/query/query_info`
Expand Down Expand Up @@ -477,3 +479,42 @@ Admin 和 Root 用户可以查看所有 Query。普通用户仅能查看自己
}
```

## 通过 Trace ID 获取查询进度

`GET /rest/v2/manager/query/statistics/{trace_id}` (4.0.0+)

### Description

通过 Trace ID,获取指定的当前正在运行的查询的统计信息。可以通过间隔调用这个接口来获取查询的进度。

### Path parameters

* `{trace_id}`

Trace ID。通过 `SET session_context="trace_id:xxxx"` 设置的用户自定义 Trace ID。

### Response

```json
{
"msg": "success",
"code": 0,
"data": {
"scanRows": 1234567,
"scanBytes": 987654321,
"returnedRows": 12345,
"cpuMs": 15600,
"maxPeakMemoryBytes": 536870912,
"currentUsedMemoryBytes": 268435456,
"shuffleSendBytes": 104857600,
"shuffleSendRows": 50000,
"scanBytesFromLocalStorage": 734003200,
"scanBytesFromRemoteStorage": 253651121,
"spillWriteBytesToLocalStorage": 0,
"spillReadBytesFromLocalStorage": 0
},
"count": 0
}
```


Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Doris 提供了对于数据库操作的审计能力,可以记录用户对数

## 审计日志文件

在 fe.conf 中,LOG\_DIR 定义了 FE 日志的存储路径。在 ${LOG\_DIR}/fe.audit.log 中记录了这台 FE 节点执行的所有数据库操作。如果需要查看集群所有的操作,需要便利每一台 FE 的审计日志。
在 fe.conf 中,`LOG_DIR` 定义了 FE 日志的存储路径。在 `${LOG_DIR}/fe.audit.log` 中记录了这台 FE 节点执行的所有数据库操作。如果需要查看集群所有的操作,需要遍历每一台 FE 的审计日志。

## 审计日志相关配置

Expand Down
6 changes: 6 additions & 0 deletions versioned_docs/version-3.0/admin-manual/audit-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ The audit log table is a dynamically partitioned table, partitioned daily by def

In `fe.conf`, `LOG_DIR` defines the storage path for FE logs. All database operations executed by this FE node are recorded in `${LOG_DIR}/fe.audit.log`. To view all operations in the cluster, you need to traverse the audit logs of each FE node.

## Audit Log Format

In versions before 3.0.7, the symbols `\n`, `\t`, and `\r` in statements would be replaced with `\\n`, `\\t`, and `\\r`. These modified statements were then stored in the `fe.audit.log` file and the `audit_log` table.

Starting from version 3.0.7, for the `fe.audit.log` file, only `\n` in statements will be replaced with `\\n`. The `audit_log` table, stores the original format of statements.

## Audit Log Configuration

**Global Variables:**
Expand Down