
 |
| kafka.version | 1.0.0 | Kafka broker版本 |
| sasl.enabled | false | 使用SASL/PLAIN进行连接 |
| sasl.handshake | true | 仅在使用非Kafka SASL代理时设置为false |
| sasl.username | SASL用户名 | |
| sasl.password | SASL用户密码 | |
| sasl.mechanism | SASL机制,可选值:plain、scram-sha512、scram-sha256 | |
| tls.enabled | false | 使用TLS进行连接 |
| tls.ca-file | TLS客户端认证的可选证书颁发机构文件 | |
| tls.cert-file | 客户端认证的可选证书文件 | |
| tls.key-file | 客户端认证的可选密钥文件 | |
| tls.insecure-skip-tls-verify | false | 若为true,将不验证服务器证书的有效性 |
| topic.filter | .* | 用于确定要收集哪些主题的正则表达式 |
| group.filter | .* | 用于确定要收集哪些消费者组的正则表达式 |
| web.listen-address | :9308 | 用于Web界面和遥测的监听地址 |
| web.telemetry-path | /metrics | 暴露指标的路径 |
| log.level | info | 仅记录指定级别及以上的日志。有效级别:[debug, info, warn, error, fatal] |
| log.enable-sarama | false | 开启Sarama日志 |
| max.offsets | 1000 | 分区插值表中存储的最大偏移量数量 |
| prune.interval | 30 | 插值表的修剪频率(秒) |
布尔值由https://github.com/alecthomas/kingpin/blob/master/README.md#boolean-values%E7%AE%A1%E7%90%86%EF%BC%8C%E6%AF%8F%E4%B8%AA%E5%B8%83%E5%B0%94%E6%A0%87%E5%BF%97%E9%83%BD%E6%9C%89%E4%B8%80%E4%B8%AA%E5%90%A6%E5%AE%9A%E5%BD%A2%E5%BC%8F%EF%BC%9A%60--和--no-
例如:
若需禁用sasl.handshake,可添加标志--no-sasl.handshake
关于暴露的Prometheus指标说明。
有关底层指标的详细信息,请参见Apache Kafka。
指标详情
| 名称 | 暴露信息 |
|---|---|
kafka_brokers | Kafka集群中的Broker数量 |
指标输出示例
txt# HELP kafka_brokers Number of Brokers in the Kafka Cluster. # TYPE kafka_brokers gauge kafka_brokers 3
指标详情
| 名称 | 暴露信息 |
|---|---|
kafka_topic_partitions | 主题的分区数量 |
kafka_topic_partition_current_offset | 主题/分区在Broker上的当前偏移量 |
kafka_topic_partition_oldest_offset | 主题/分区在Broker上的最旧偏移量 |
kafka_topic_partition_in_sync_replica | 主题/分区的同步副本数量 |
kafka_topic_partition_leader | 主题/分区的Leader Broker ID |
kafka_topic_partition_leader_is_preferred | 1表示主题/分区使用首选Broker |
kafka_topic_partition_replicas | 主题/分区的副本数量 |
kafka_topic_partition_under_replicated_partition | 1表示主题/分区为欠复制分区 |
指标输出示例
txt# HELP kafka_topic_partitions Number of partitions for this Topic # TYPE kafka_topic_partitions gauge kafka_topic_partitions{topic="__consumer_offsets"} 50 # HELP kafka_topic_partition_current_offset Current Offset of a Broker at Topic/Partition # TYPE kafka_topic_partition_current_offset gauge kafka_topic_partition_current_offset{partition="0",topic="__consumer_offsets"} 0 # HELP kafka_topic_partition_oldest_offset Oldest Offset of a Broker at Topic/Partition # TYPE kafka_topic_partition_oldest_offset gauge kafka_topic_partition_oldest_offset{partition="0",topic="__consumer_offsets"} 0 # HELP kafka_topic_partition_in_sync_replica Number of In-Sync Replicas for this Topic/Partition # TYPE kafka_topic_partition_in_sync_replica gauge kafka_topic_partition_in_sync_replica{partition="0",topic="__consumer_offsets"} 3 # HELP kafka_topic_partition_leader Leader Broker ID of this Topic/Partition # TYPE kafka_topic_partition_leader gauge kafka_topic_partition_leader{partition="0",topic="__consumer_offsets"} 0 # HELP kafka_topic_partition_leader_is_preferred 1 if Topic/Partition is using the Preferred Broker # TYPE kafka_topic_partition_leader_is_preferred gauge kafka_topic_partition_leader_is_preferred{partition="0",topic="__consumer_offsets"} 1 # HELP kafka_topic_partition_replicas Number of Replicas for this Topic/Partition # TYPE kafka_topic_partition_replicas gauge kafka_topic_partition_replicas{partition="0",topic="__consumer_offsets"} 3 # HELP kafka_topic_partition_under_replicated_partition 1 if Topic/Partition is under Replicated # TYPE kafka_topic_partition_under_replicated_partition gauge kafka_topic_partition_under_replicated_partition{partition="0",topic="__consumer_offsets"} 0
指标详情
| 名称 | 暴露信息 |
|---|---|
kafka_consumergroup_current_offset | 消费者组在主题/分区上的当前偏移量 |
kafka_consumergroup_lag | 消费者组在主题/分区上的当前近似延迟 |
指标输出示例
txt# HELP kafka_consumergroup_current_offset Current Offset of a ConsumerGroup at Topic/Partition # TYPE kafka_consumergroup_current_offset gauge kafka_consumergroup_current_offset{consumergroup="KMOffsetCache-kafka-manager-3806276532-ml44w",partition="0",topic="__consumer_offsets"} -1 # HELP kafka_consumergroup_lag Current Approximate Lag of a ConsumerGroup at Topic/Partition # TYPE kafka_consumergroup_lag gauge kafka_consumergroup_lag{consumergroup="KMOffsetCache-kafka-manager-3806276532-ml44w",partition="0",topic="__consumer_offsets"} 1
指标详情
| 名称 | 暴露信息 |
|---|---|
kafka_consumer_lag_millis | 消费者组在主题/分区上的当前近似延迟(毫秒) |
kafka_consumer_lag_extrapolation | 表示消费者组延迟估计使用了外推法 |
kafka_consumer_lag_interpolation | 表示消费者组延迟估计使用了插值法 |
指标输出示例
# HELP kafka_consumer_lag_extrapolation Indicates that a consumer group lag estimation used extrapolation # TYPE kafka_consumer_lag_extrapolation counter kafka_consumer_lag_extrapolation{consumergroup="perf-consumer-74084",partition="0",topic="test"} 1 # HELP kafka_consumer_lag_interpolation Indicates that a consumer group lag estimation used interpolation # TYPE kafka_consumer_lag_interpolation counter kafka_consumer_lag_interpolation{consumergroup="perf-consumer-74084",partition="0",topic="test"} 1 # HELP kafka_consumer_lag_millis Current approximation of consumer lag for a ConsumerGroup at Topic/Partition # TYPE kafka_consumer_lag_millis gauge kafka_consumer_lag_millis{consumergroup="perf-consumer-74084",partition="0",topic="test"} 3.4457231197552e+10
Grafana仪表板ID:7589,名称:Kafka Exporter Overview。
有关仪表板的详细信息,请参见Kafka Exporter Overview。
消费者组、主题和分区的延迟估计技术借鉴自https://github.com/lightbend/kafka-lag-exporter%E3%80%82
导出器启动后,开始采样要生成的下一个偏移量。插值表由这些样本构建,每个受监控消费者组的当前偏移量与表中的值进行比较。如果表中包含消费者组当前偏移量的上下界,则使用插值法;如果仅包含上界,则使用外推法。
在可配置的间隔prune.interval(默认30秒)内,会执行插值表的修剪操作。任何不再被broker列出的消费者组或主题将被移除。每个分区的偏移量数量会被修剪至max.offsets(默认1000),最旧的偏移量会被优先移除。
插值表的修剪在单独的线程上进行,通过插值表周围的锁确保线程安全。
如需向上游项目贡献,请提交https://github.com/danielqsj/kafka_exporter/pulls%E3%80%82
如需向此分支贡献,请在此提交https://github.com/davidmparrott/kafka_exporter/pulls%E3%80%82
如需向本项目的原始开发者***,请使用以下***链接
代码基于https://github.com/danielqsj/kafka_exporter/blob/master/LICENSE%E8%AE%B8%E5%8F%AF%E3%80%82
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。



探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
docker search 限制
站内搜不到镜像
离线 save/load
插件要用 plugin install
WSL 拉取慢
安全与 digest
新手拉取配置
镜像合规机制
manifest unknown
no matching manifest(架构)
invalid tar header(解压)
TLS 证书失败
DNS 超时
域名连通性排查
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务