Skip to content

Commit

Permalink
[FLINK-37231][docs] Add documentation for CDC Source metrics
Browse files Browse the repository at this point in the history
This closes #3897
  • Loading branch information
lvyanquan authored Feb 6, 2025
1 parent 8d54be6 commit 7717779
Show file tree
Hide file tree
Showing 16 changed files with 321 additions and 0 deletions.
20 changes: 20 additions & 0 deletions docs/content.zh/docs/connectors/flink-sources/db2-cdc.md
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,26 @@ public class Db2SourceExample {
}
```

### 可用的指标

指标系统能够帮助了解分片分发的进展, 下面列举出了支持的 Flink 指标 [Flink metrics](https://nightlies.apache.org/flink/flink-docs-master/docs/ops/metrics/):

| Group | Name | Type | Description |
|------------------------|----------------------------|-------|----------------|
| namespace.schema.table | isSnapshotting | Gauge | 表是否在快照读取阶段 |
| namespace.schema.table | isStreamReading | Gauge | 表是否在增量读取阶段 |
| namespace.schema.table | numTablesSnapshotted | Gauge | 已经被快照读取完成的表的数量 |
| namespace.schema.table | numTablesRemaining | Gauge | 还没有被快照读取的表的数据 |
| namespace.schema.table | numSnapshotSplitsProcessed | Gauge | 正在处理的分片的数量 |
| namespace.schema.table | numSnapshotSplitsRemaining | Gauge | 还没有被处理的分片的数量 |
| namespace.schema.table | numSnapshotSplitsFinished | Gauge | 已经处理完成的分片的数据 |
| namespace.schema.table | snapshotStartTime | Gauge | 快照读取阶段开始的时间 |
| namespace.schema.table | snapshotEndTime | Gauge | 快照读取阶段结束的时间 |

注意:
1. Group 名称是 `namespace.schema.table`,这里的 `namespace` 是实际的数据库名称, `schema` 是实际的 schema 名称, `table` 是实际的表名称。
2. 对于 DB2,Group 的名称会类似于 `test_database.test_schema.test_table`

The DB2 CDC incremental connector (since 3.1.0) can be used as the following shows:
```java
import org.apache.flink.api.common.eventtime.WatermarkStrategy;
Expand Down
20 changes: 20 additions & 0 deletions docs/content.zh/docs/connectors/flink-sources/mongodb-cdc.md
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,26 @@ public class MongoDBIncrementalSourceExample {
- 如果使用数据库正则表达式,则需要 `readAnyDatabase` 角色。
- 增量快照功能仅支持 MongoDB 4.0 之后的版本。
### 可用的指标
指标系统能够帮助了解分片分发的进展, 下面列举出了支持的 Flink 指标 [Flink metrics](https://nightlies.apache.org/flink/flink-docs-master/docs/ops/metrics/):
| Group | Name | Type | Description |
|------------------------|----------------------------|-------|----------------|
| namespace.schema.table | isSnapshotting | Gauge | 表是否在快照读取阶段 |
| namespace.schema.table | isStreamReading | Gauge | 表是否在增量读取阶段 |
| namespace.schema.table | numTablesSnapshotted | Gauge | 已经被快照读取完成的表的数量 |
| namespace.schema.table | numTablesRemaining | Gauge | 还没有被快照读取的表的数据 |
| namespace.schema.table | numSnapshotSplitsProcessed | Gauge | 正在处理的分片的数量 |
| namespace.schema.table | numSnapshotSplitsRemaining | Gauge | 还没有被处理的分片的数量 |
| namespace.schema.table | numSnapshotSplitsFinished | Gauge | 已经处理完成的分片的数据 |
| namespace.schema.table | snapshotStartTime | Gauge | 快照读取阶段开始的时间 |
| namespace.schema.table | snapshotEndTime | Gauge | 快照读取阶段结束的时间 |
注意:
1. Group 名称是 `namespace.schema.table`,这里的 `namespace` 是实际的数据库名称, `schema` 是实际的 schema 名称, `table` 是实际的表名称。
2. 对于 MongoDB,这里的 `namespace` 会被设置成默认值 "",也就是一个空字符串,Group 名称的格式会类似于 `test_database.test_table`。
### 完整的 Changelog
MongoDB 6.0 以及更高的版本支持发送变更流事件,其中包含文档的更新前和更新后的内容(或者说数据的前后镜像)。
Expand Down
20 changes: 20 additions & 0 deletions docs/content.zh/docs/connectors/flink-sources/mysql-cdc.md
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,26 @@ $ ./bin/flink run \
* 如果指定的列不存在更新操作,此时可以保证 Exactly once 语义。
* 如果指定的列存在更新操作,此时只能保证 At least once 语义。但可以结合下游,通过指定下游主键,结合幂等性操作来保证数据的正确性。

### 可用的指标

指标系统能够帮助了解分片分发的进展, 下面列举出了支持的 Flink 指标 [Flink metrics](https://nightlies.apache.org/flink/flink-docs-master/docs/ops/metrics/):

| Group | Name | Type | Description |
|------------------------|----------------------------|-------|----------------|
| namespace.schema.table | isSnapshotting | Gauge | 表是否在快照读取阶段 |
| namespace.schema.table | isStreamReading | Gauge | 表是否在增量读取阶段 |
| namespace.schema.table | numTablesSnapshotted | Gauge | 已经被快照读取完成的表的数量 |
| namespace.schema.table | numTablesRemaining | Gauge | 还没有被快照读取的表的数据 |
| namespace.schema.table | numSnapshotSplitsProcessed | Gauge | 正在处理的分片的数量 |
| namespace.schema.table | numSnapshotSplitsRemaining | Gauge | 还没有被处理的分片的数量 |
| namespace.schema.table | numSnapshotSplitsFinished | Gauge | 已经处理完成的分片的数据 |
| namespace.schema.table | snapshotStartTime | Gauge | 快照读取阶段开始的时间 |
| namespace.schema.table | snapshotEndTime | Gauge | 快照读取阶段结束的时间 |

注意:
1. Group 名称是 `namespace.schema.table`,这里的 `namespace` 是实际的数据库名称, `schema` 是实际的 schema 名称, `table` 是实际的表名称。
2. 对于 MySQL,这里的 `namespace` 会被设置成默认值 "",也就是一个空字符串,Group 名称的格式会类似于 `test_database.test_table`。

数据类型映射
----------------

Expand Down
20 changes: 20 additions & 0 deletions docs/content.zh/docs/connectors/flink-sources/oceanbase-cdc.md
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,26 @@ public class OceanBaseSourceExample {
}
```
### 可用的指标
指标系统能够帮助了解分片分发的进展, 下面列举出了支持的 Flink 指标 [Flink metrics](https://nightlies.apache.org/flink/flink-docs-master/docs/ops/metrics/):
| Group | Name | Type | Description |
|------------------------|----------------------------|-------|----------------|
| namespace.schema.table | isSnapshotting | Gauge | 表是否在快照读取阶段 |
| namespace.schema.table | isStreamReading | Gauge | 表是否在增量读取阶段 |
| namespace.schema.table | numTablesSnapshotted | Gauge | 已经被快照读取完成的表的数量 |
| namespace.schema.table | numTablesRemaining | Gauge | 还没有被快照读取的表的数据 |
| namespace.schema.table | numSnapshotSplitsProcessed | Gauge | 正在处理的分片的数量 |
| namespace.schema.table | numSnapshotSplitsRemaining | Gauge | 还没有被处理的分片的数量 |
| namespace.schema.table | numSnapshotSplitsFinished | Gauge | 已经处理完成的分片的数据 |
| namespace.schema.table | snapshotStartTime | Gauge | 快照读取阶段开始的时间 |
| namespace.schema.table | snapshotEndTime | Gauge | 快照读取阶段结束的时间 |
注意:
1. Group 名称是 `namespace.schema.table`,这里的 `namespace` 是实际的数据库名称, `schema` 是实际的 schema 名称, `table` 是实际的表名称。
2. 对于 OceanBase,这里的 `namespace` 会被设置成默认值 "",也就是一个空字符串,Group 名称的格式会类似于 `test_database.test_table`
数据类型映射
----------------
Expand Down
20 changes: 20 additions & 0 deletions docs/content.zh/docs/connectors/flink-sources/oracle-cdc.md
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,26 @@ public class OracleSourceExample {
}
```
### 可用的指标
指标系统能够帮助了解分片分发的进展, 下面列举出了支持的 Flink 指标 [Flink metrics](https://nightlies.apache.org/flink/flink-docs-master/docs/ops/metrics/):
| Group | Name | Type | Description |
|------------------------|----------------------------|-------|----------------|
| namespace.schema.table | isSnapshotting | Gauge | 表是否在快照读取阶段 |
| namespace.schema.table | isStreamReading | Gauge | 表是否在增量读取阶段 |
| namespace.schema.table | numTablesSnapshotted | Gauge | 已经被快照读取完成的表的数量 |
| namespace.schema.table | numTablesRemaining | Gauge | 还没有被快照读取的表的数据 |
| namespace.schema.table | numSnapshotSplitsProcessed | Gauge | 正在处理的分片的数量 |
| namespace.schema.table | numSnapshotSplitsRemaining | Gauge | 还没有被处理的分片的数量 |
| namespace.schema.table | numSnapshotSplitsFinished | Gauge | 已经处理完成的分片的数据 |
| namespace.schema.table | snapshotStartTime | Gauge | 快照读取阶段开始的时间 |
| namespace.schema.table | snapshotEndTime | Gauge | 快照读取阶段结束的时间 |
注意:
1. Group 名称是 `namespace.schema.table`,这里的 `namespace` 是实际的数据库名称, `schema` 是实际的 schema 名称, `table` 是实际的表名称。
2. 对于 Oracle,Group 的名称会类似于 `test_database.test_schema.test_table`。
Data Type Mapping
----------------
<div class="wy-table-responsive">
Expand Down
20 changes: 20 additions & 0 deletions docs/content.zh/docs/connectors/flink-sources/postgres-cdc.md
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,26 @@ public class PostgreSQLSourceExample {
}
```

### 可用的指标

指标系统能够帮助了解分片分发的进展, 下面列举出了支持的 Flink 指标 [Flink metrics](https://nightlies.apache.org/flink/flink-docs-master/docs/ops/metrics/):

| Group | Name | Type | Description |
|------------------------|----------------------------|-------|----------------|
| namespace.schema.table | isSnapshotting | Gauge | 表是否在快照读取阶段 |
| namespace.schema.table | isStreamReading | Gauge | 表是否在增量读取阶段 |
| namespace.schema.table | numTablesSnapshotted | Gauge | 已经被快照读取完成的表的数量 |
| namespace.schema.table | numTablesRemaining | Gauge | 还没有被快照读取的表的数据 |
| namespace.schema.table | numSnapshotSplitsProcessed | Gauge | 正在处理的分片的数量 |
| namespace.schema.table | numSnapshotSplitsRemaining | Gauge | 还没有被处理的分片的数量 |
| namespace.schema.table | numSnapshotSplitsFinished | Gauge | 已经处理完成的分片的数据 |
| namespace.schema.table | snapshotStartTime | Gauge | 快照读取阶段开始的时间 |
| namespace.schema.table | snapshotEndTime | Gauge | 快照读取阶段结束的时间 |

注意:
1. Group 名称是 `namespace.schema.table`,这里的 `namespace` 是实际的数据库名称, `schema` 是实际的 schema 名称, `table` 是实际的表名称。
2. 对于 PostgreSQL,Group 的名称会类似于 `test_database.test_schema.test_table`

Data Type Mapping
----------------

Expand Down
20 changes: 20 additions & 0 deletions docs/content.zh/docs/connectors/flink-sources/sqlserver-cdc.md
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,26 @@ public class SqlServerIncrementalSourceExample {
}
```

### 可用的指标

指标系统能够帮助了解分片分发的进展, 下面列举出了支持的 Flink 指标 [Flink metrics](https://nightlies.apache.org/flink/flink-docs-master/docs/ops/metrics/):

| Group | Name | Type | Description |
|------------------------|----------------------------|-------|----------------|
| namespace.schema.table | isSnapshotting | Gauge | 表是否在快照读取阶段 |
| namespace.schema.table | isStreamReading | Gauge | 表是否在增量读取阶段 |
| namespace.schema.table | numTablesSnapshotted | Gauge | 已经被快照读取完成的表的数量 |
| namespace.schema.table | numTablesRemaining | Gauge | 还没有被快照读取的表的数据 |
| namespace.schema.table | numSnapshotSplitsProcessed | Gauge | 正在处理的分片的数量 |
| namespace.schema.table | numSnapshotSplitsRemaining | Gauge | 还没有被处理的分片的数量 |
| namespace.schema.table | numSnapshotSplitsFinished | Gauge | 已经处理完成的分片的数据 |
| namespace.schema.table | snapshotStartTime | Gauge | 快照读取阶段开始的时间 |
| namespace.schema.table | snapshotEndTime | Gauge | 快照读取阶段结束的时间 |

注意:
1. Group 名称是 `namespace.schema.table`,这里的 `namespace` 是实际的数据库名称, `schema` 是实际的 schema 名称, `table` 是实际的表名称。
2. 对于 SQLServer,Group 的名称会类似于 `test_database.test_schema.test_table`

Data Type Mapping
----------------

Expand Down
20 changes: 20 additions & 0 deletions docs/content.zh/docs/connectors/pipeline-connectors/mysql.md
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,26 @@ source:
# ...
```

### 可用的指标

指标系统能够帮助了解分片分发的进展, 下面列举出了支持的 Flink 指标 [Flink metrics](https://nightlies.apache.org/flink/flink-docs-master/docs/ops/metrics/):

| Group | Name | Type | Description |
|------------------------|----------------------------|-------|----------------|
| namespace.schema.table | isSnapshotting | Gauge | 表是否在快照读取阶段 |
| namespace.schema.table | isStreamReading | Gauge | 表是否在增量读取阶段 |
| namespace.schema.table | numTablesSnapshotted | Gauge | 已经被快照读取完成的表的数量 |
| namespace.schema.table | numTablesRemaining | Gauge | 还没有被快照读取的表的数据 |
| namespace.schema.table | numSnapshotSplitsProcessed | Gauge | 正在处理的分片的数量 |
| namespace.schema.table | numSnapshotSplitsRemaining | Gauge | 还没有被处理的分片的数量 |
| namespace.schema.table | numSnapshotSplitsFinished | Gauge | 已经处理完成的分片的数据 |
| namespace.schema.table | snapshotStartTime | Gauge | 快照读取阶段开始的时间 |
| namespace.schema.table | snapshotEndTime | Gauge | 快照读取阶段结束的时间 |

注意:
1. Group 名称是 `namespace.schema.table`,这里的 `namespace` 是实际的数据库名称, `schema` 是实际的 schema 名称, `table` 是实际的表名称。
2. 对于 MySQL,这里的 `namespace` 会被设置成默认值 "",也就是一个空字符串,Group 名称的格式会类似于 `test_database.test_table`。

## 数据类型映射

<div class="wy-table-responsive">
Expand Down
20 changes: 20 additions & 0 deletions docs/content/docs/connectors/flink-sources/db2-cdc.md
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,26 @@ public class Db2ParallelSourceExample {
}
```

### Available Source metrics

Metrics can help understand the progress of assignments, and the following are the supported [Flink metrics](https://nightlies.apache.org/flink/flink-docs-master/docs/ops/metrics/):

| Group | Name | Type | Description |
|------------------------|----------------------------|-------|-----------------------------------------------------|
| namespace.schema.table | isSnapshotting | Gauge | Weather the table is snapshotting or not |
| namespace.schema.table | isStreamReading | Gauge | Weather the table is stream reading or not |
| namespace.schema.table | numTablesSnapshotted | Gauge | The number of tables that have been snapshotted |
| namespace.schema.table | numTablesRemaining | Gauge | The number of tables that have not been snapshotted |
| namespace.schema.table | numSnapshotSplitsProcessed | Gauge | The number of splits that is being processed |
| namespace.schema.table | numSnapshotSplitsRemaining | Gauge | The number of splits that have not been processed |
| namespace.schema.table | numSnapshotSplitsFinished | Gauge | The number of splits that have been processed |
| namespace.schema.table | snapshotStartTime | Gauge | The time when the snapshot started |
| namespace.schema.table | snapshotEndTime | Gauge | The time when the snapshot ended |

Notice:
1. The group name is `namespace.schema.table`, where `namespace` is the actual database name, `schema` is the actual schema name, and `table` is the actual table name.
2. For DB2, the group name will be like `test_database.test_schema.test_table`.

Data Type Mapping
----------------

Expand Down
20 changes: 20 additions & 0 deletions docs/content/docs/connectors/flink-sources/mongodb-cdc.md
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,26 @@ CREATE TABLE mongodb_source (...) WITH (
)
```

### Available Source metrics

Metrics can help understand the progress of assignments, and the following are the supported [Flink metrics](https://nightlies.apache.org/flink/flink-docs-master/docs/ops/metrics/):

| Group | Name | Type | Description |
|------------------------|----------------------------|-------|-----------------------------------------------------|
| namespace.schema.table | isSnapshotting | Gauge | Weather the table is snapshotting or not |
| namespace.schema.table | isStreamReading | Gauge | Weather the table is stream reading or not |
| namespace.schema.table | numTablesSnapshotted | Gauge | The number of tables that have been snapshotted |
| namespace.schema.table | numTablesRemaining | Gauge | The number of tables that have not been snapshotted |
| namespace.schema.table | numSnapshotSplitsProcessed | Gauge | The number of splits that is being processed |
| namespace.schema.table | numSnapshotSplitsRemaining | Gauge | The number of splits that have not been processed |
| namespace.schema.table | numSnapshotSplitsFinished | Gauge | The number of splits that have been processed |
| namespace.schema.table | snapshotStartTime | Gauge | The time when the snapshot started |
| namespace.schema.table | snapshotEndTime | Gauge | The time when the snapshot ended |

Notice:
1. The group name is `namespace.schema.table`, where `namespace` is the actual database name, `schema` is the actual schema name, and `table` is the actual table name.
2. For MongoDB, the `namespace` will be set to the default value "", and the group name will be like `test_database.test_table`.

Data Type Mapping
----------------
[BSON](https://docs.mongodb.com/manual/reference/bson-types/) short for **Binary JSON** is a binary-encoded serialization of JSON-like format used to store documents and make remote procedure calls in MongoDB.
Expand Down
Loading

0 comments on commit 7717779

Please sign in to comment.