system.kafka_consumers
在 ClickHouse Cloud 中进行查询
该系统表中的数据保存在 ClickHouse Cloud 中每个节点的本地。因此,如需获得所有数据的完整视图,需要使用 clusterAllReplicas 函数。更多详情请参阅此处。
包含 Kafka consumer 的相关信息。 适用于 Kafka 表引擎(ClickHouse 原生集成)。
列:
database(String) — 具有 Kafka Engine 的表所属的数据库。table(String) — 具有 Kafka Engine 的表名。consumer_id(String) — Kafka 消费者标识符。注意,一个表可以有多个消费者。由kafka_num_consumers参数指定。assignments.topic(Array(String)) — Kafka 主题。assignments.partition_id(Array(Int32)) — Kafka 分区 ID。注意,同一分区只能分配给一个消费者。assignments.current_offset(Array(Int64)) — 当前 offset。assignments.intent_size(Array(Nullable(Int64))) — 在新的 StorageKafka 中已推送但尚未提交的消息数量。exceptions.time(Array(DateTime)) — 最近 10 条异常生成时的时间戳。exceptions.text(Array(String)) — 最近 10 条异常的文本内容。last_poll_time(DateTime) — 最近一次 poll 的时间戳。num_messages_read(UInt64) — 消费者已读取的消息数量。last_commit_time(DateTime) — 最近一次提交的时间戳。num_commits(UInt64) — 该消费者的提交总次数。last_rebalance_time(DateTime) — 最近一次 Kafka rebalance 的时间戳。num_rebalance_revocations(UInt64) — 消费者被撤销其分区的次数。num_rebalance_assignments(UInt64) — 消费者被分配到 Kafka 集群的次数。is_currently_used(UInt8) — 指示该消费者当前是否在使用的标志。last_used(DateTime64(6)) — 该消费者最近一次被使用的时间。rdkafka_stat(String) — 库内部统计信息。将 statistics_interval_ms 设置为 0 可禁用,默认值为 3000(每三秒一次)。dependencies(Array(Array(String))) — 传递数据库依赖关系。missing_dependencies(Array(Array(String))) — 缺失的传递数据库依赖关系。
示例: