prometheus.exporter.kafka
prometheus.exporter.kafka
组件集成了 kafka_exporter 以收集来自 Kafka 服务器的度量信息。
用法
prometheus.exporter.kafka "LABEL" {
kafka_uris = KAFKA_URI_LIST
}
参数
您可以使用以下参数来配置导出器的行为。省略的字段将采用其默认值。
名称 | 类型 | 描述 | 默认值 | 必需 |
---|---|---|---|---|
kafka_uris | array(string) | Address array (host:port) of Kafka server. | yes | |
instance | string | The instance label for metrics, default is the hostname:port of the first kafka_uris. You must manually provide the instance value if there is more than one string in kafka_uris. | no | |
use_sasl | bool | Connect using SASL/PLAIN. | no | |
use_sasl_handshake | bool | Only set this to false if using a non-Kafka SASL proxy. | true | no |
sasl_username | string | SASL user name. | no | |
sasl_password | string | SASL user password. | no | |
sasl_mechanism | string | The SASL SCRAM SHA algorithm sha256 or sha512 as mechanism. | no | |
sasl_disable_pafx_fast | bool | Configure the Kerberos client to not use PA_FX_FAST. | no | |
use_tls | bool | Connect using TLS. | no | |
tls_server_name | string | Used to verify the hostname on the returned certificates unless tls.insecure-skip-tls-verify is given. If you don’t provide the Kafka server name, the hostname is taken from the URL. | no | |
ca_file | string | The optional certificate authority file for TLS client authentication. | no | |
cert_file | string | The optional certificate file for TLS client authentication. | no | |
key_file | string | The optional key file for TLS client authentication. | no | |
insecure_skip_verify | bool | If set to true, the server’s certificate will not be checked for validity. This makes your HTTPS connections insecure. | no | |
kafka_version | string | Kafka broker version. | 2.0.0 | no |
use_zookeeper_lag | bool | If set to true, use a group from zookeeper. | no | |
zookeeper_uris | array(string) | Address array (hosts) of zookeeper server. | no | |
kafka_cluster_name | string | Kafka cluster name. | no | |
metadata_refresh_interval | duration | Metadata refresh interval. | 1m | no |
gssapi_service_name | string | Service name when using Kerberos Authorization | no | |
gssapi_kerberos_config_path | string | Kerberos config path. | no | |
gssapi_realm | string | Kerberos realm. | no | |
gssapi_key_tab_path | string | Kerberos keytab file path. | no | |
gssapi_kerberos_auth_type | string | Kerberos auth type.Either ‘keytabAuth’ or ‘userAuth’. | no | |
offset_show_all | bool | If true, the broker may auto-create topics that we requested which do not already exist. | true | no |
topic_workers | int | Minimum number of topics to monitor. | 100 | no |
allow_concurrency | bool | If set to true, all scrapes trigger Kafka operations. Otherwise, they will share results. WARNING: Disable this on large clusters. | true | no |
allow_auto_topic_creation | bool | If true, the broker may auto-create topics that we requested which do not already exist. | no | |
max_offsets | int | 存储到分区的插值表中最大偏移数量。 | 1000 | no |
prune_interval_seconds | int | 已废弃(无操作),请使用 metadata_refresh_interval 代替。 | 30 | no |
topics_filter_regex | string | 用于监控主题的正则表达式过滤器。 | .* | no |
topics_exclude_regex | string | 确定要排除的主题的正则表达式。 | ^$ | no |
groups_filter_regex | string | 用于监控消费者组的正则表达式过滤器。 | .* | no |
groups_exclude_regex | string | 用于确定要排除的消费者组的正则表达式。 | ^$ | no |
导出字段
以下字段被导出,可以被其他组件引用。
名称 | 类型 | 描述 |
---|---|---|
targets | 列表(map(string)) | 可以用于收集导出度量值的目标。 |
例如,targets
可以传递给 discovery.relabel
组件以重写目标的标签集,或者传递给收集公开度量的 prometheus.scrape
组件。
组件健康
prometheus.exporter.kafka
只有在提供无效配置时才会报告为不健康。在这些情况下,导出的字段保留其最后健康值。
调试信息
prometheus.exporter.kafka
不公开任何特定组件的调试信息。
调试度量
prometheus.exporter.kafka
不公开任何特定组件的调试度量。
示例
此示例使用 prometheus.scrape
组件 从 prometheus.exporter.kafka
收集度量值
prometheus.exporter.kafka "example" {
kafka_uris = ["localhost:9200"]
}
// Configure a prometheus.scrape component to send metrics to.
prometheus.scrape "demo" {
targets = prometheus.exporter.kafka.example.targets
forward_to = [prometheus.remote_write.demo.receiver]
}
prometheus.remote_write "demo" {
endpoint {
url = PROMETHEUS_REMOTE_WRITE_URL
basic_auth {
username = USERNAME
password = PASSWORD
}
}
}
替换以下内容
PROMETHEUS_REMOTE_WRITE_URL
:发送度量值的服务器兼容 Prometheus remote_write 的 URL。USERNAME
:用于远程_write API 认证的用户名。PASSWORD
:用于远程_write API 认证的密码。
兼容组件
prometheus.exporter.kafka
的导出可以被以下组件接收
- 消费 目标 的组件
注意
连接某些组件可能不合理,或者组件可能需要进一步配置才能正确连接。有关详细信息,请参阅相关文档。