我无法为 Confluent 连接服务导出“type=connector-metrics”指标,但其他指标工作正常。
我正在使用 prometheus exporter java 代理从 Confluent connect 公开指标,如下所示。
Confluent 连接配置 (/usr/bin/connect-distributed)
export KAFKA_OPTS='-javaagent:/opt/prometheus/jmx_prometheus_javaagent-0.12.0.jar=8093:/opt/prometheus/kafka-connect.yml'
kafka-connect.yml
- pattern: kafka.connect<type=connector-metrics, connector=(.+)><>([a-z-]+)
name: kafka_connector_$2
labels:
connector: "$1"
help: "Kafka Connect JMX metric $1"
type: GAUGE
使用 JMXTERM 工具,我可以看到“type=connector-metrics”的属性
$>bean kafka.connect:connector=local-file-sink,type=connector-metrics
#bean is set to kafka.connect:connector=local-file-sink,type=connector-metrics
$>info
#mbean = kafka.connect:connector=local-file-sink,type=connector-metrics
#class name = org.apache.kafka.common.metrics.JmxReporter$KafkaMbean
# attributes
%0 - connector-class (double, r)
%1 - connector-type (double, r)
%2 - connector-version (double, r)
%3 - status (double, r)
#there's no operations
#there's no notifications
$>get connector-type
#mbean = kafka.connect:connector=local-file-sink,type=connector-metrics:
connector-type = sink;
$>get status
#mbean = kafka.connect:connector=local-file-sink,type=connector-metrics:
status = running;
汇合连接版本 - 5.4
有什么建议可以解决上述问题吗?