kafka-exporter部署手册

来源

https://github.com/danielqsj/kafka_exporter

说明

Prometheus 的 Kafka 导出器。有关 Kafka 的其他指标,请查看 JMX 导出器JMX 导出器

兼容性

Apache Kafka 版本 0.10.1.0及以上。

部署方式:

docker方式
docker pull danielqsj/kafka-exporter:latest
二进制文件方式

下载地址:
https://github.com/danielqsj/kafka_exporter/releases/download/v1.3.1/kafka_exporter-1.3.1.linux-amd64.tar.gz

解压进入当前项目目录后执行 ./kafka_exporter --help 可查看具体配置方式:

usage: kafka_exporter [<flags>]

Flags:
  -h, --help                   Show context-sensitive help (also try --help-long
                               and --help-man).
      --web.listen-address=":9308"
                               Address to listen on for web interface and
                               telemetry.
      --web.telemetry-path="/metrics"
                               Path under which to expose metrics.
      --topic.filter=".*"      Regex that determines which topics to collect.
      --group.filter=".*"      Regex that determines which consumer groups to
                               collect.
      --log.enable-sarama      Turn on Sarama logging.
      --kafka.server=kafka:9092 ...
                               Address (host:port) of Kafka server.
      --sasl.enabled           Connect using SASL/PLAIN.
      --sasl.handshake         Only set this to false if using a non-Kafka SASL
                               proxy.
      --sasl.username=""       SASL user name.
      --sasl.password=""       SASL user password.
      --tls.enabled            Connect using TLS.
      --tls.ca-file=""         The optional certificate authority file for TLS
                               client authentication.
      --tls.cert-file=""       The optional certificate file for client
                               authentication.
      --tls.key-file=""        The optional key file for client authentication.
      --tls.insecure-skip-tls-verify
                               If true, the server's certificate will not be
                               checked for validity. This will make your HTTPS
                               connections insecure.
      --kafka.version="1.0.0"  Kafka broker version
      --log.level="info"       Only log messages with the given severity or
                               above. Valid levels: [debug, info, warn, error,
                               fatal]
      --log.format="logger:stderr"
                               Set the log target and format. Example:
                               "logger:syslog?appname=bob&local=7" or
                               "logger:stdout?json=true"
      --version                Show application version.

可根据需求自定义部署;

注:
该exporter支持多台kafka方式部署:

docker run -ti --rm -p 9308:9308 danielqsj/kafka-exporter --kafka.server=kafka:9092 [--kafka.server=another-server ...]
kafka_exporter --kafka.server=kafka:9092 [--kafka.server=another-server ...]

具体配置描述

Flag nameDefaultDescription
kafka.serverkafka:9092Addresses (host:port) of Kafka server
kafka.version1.0.0Kafka broker version
sasl.enabledfalseConnect using SASL/PLAIN
sasl.handshaketrueOnly set this to false if using a non-Kafka SASL proxy
sasl.usernameSASL user name
sasl.passwordSASL user password
sasl.mechanismSASL mechanism can be plain, scram-sha512, scram-sha256
sasl.service-nameService name when using Kerberos Auth
sasl.kerberos-config-pathKerberos config path
sasl.realmKerberos realm
sasl.keytab-pathKerberos keytab file path
sasl.kerberos-auth-typeKerberos auth type. Either ‘keytabAuth’ or ‘userAuth’
tls.enabledfalseConnect using TLS
tls.ca-fileThe optional certificate authority file for TLS client authentication
tls.cert-fileThe optional certificate file for client authentication
tls.key-fileThe optional key file for client authentication
tls.insecure-skip-tls-verifyfalseIf true, the server’s certificate will not be checked for validity
topic.filter.*Regex that determines which topics to collect
group.filter.*Regex that determines which consumer groups to collect
web.listen-address:9308Address to listen on for web interface and telemetry
web.telemetry-path/metricsPath under which to expose metrics
log.levelinfoOnly log messages with the given severity or above. Valid levels: [debug, info, warn, error, fatal]
log.enable-saramafalseTurn on Sarama logging
Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐