我无法导出"type=连接器度量";Confluent连接服务的指标,但其他指标运行良好。
我使用prometheus导出器java代理来公开Confluent connect的度量,如下所示。
汇流连接配置(/usr/bin/Connect distributed(
export KAFKA_OPTS='-javaagent:/opt/prometheus/jmx_prometheus_javaagent-0.112.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=连接器度量";
$>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
有什么解决上述问题的建议吗?
我一直在为同样的问题头疼。此后,我通过升级到最新的jmx_exporter(0.13.0(找到了一个修复程序,并使用了示例连接器导出器配置文件(https://github.com/prometheus/jmx_exporter)。我找不到一个变化日志来说明发生了什么变化,但他们"固定的";某物
问题似乎是连接器度量的属性类型是double,但值是string。
以下是我如何获得状态度量的示例:
# kafka.connect:type=connector-metrics,connector="{connector}"
- pattern: 'kafka.connect<type=connector-metrics, connector=(.+)><>status: ([a-z-]+)'
name: kafka_connectors_status
value: 1
labels:
connector: $1
status: $2
help: "Kafka Connect JMX metric connectors status"
type: GAUGE