使用 Jmx Exporter for Prometheus 丢失 Confluent Kafka Connect Metrics [英] Missing Confluent Kafka Connect Metrics using Jmx Exporter for Prometheus

查看:62
本文介绍了使用 Jmx Exporter for Prometheus 丢失 Confluent Kafka Connect Metrics的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法导出type=connector-metrics"Confluent 连接服务的指标,但其他指标运行良好.

I am not able to export "type=connector-metrics" metrics for Confluent connect service but other metrics are working fine.

我正在使用 prometheus 导出器 java 代理从 Confluent 连接公开指标,如下所示.

I am using prometheus exporter java agent to expose metrics from Confluent connect as shown below.

导出 KAFKA_OPTS='-javaagent:/opt/prometheus/jmx_prometheus_javaagent-0.12.0.jar=8093:/opt/prometheus/kafka-connect.yml'

export KAFKA_OPTS='-javaagent:/opt/prometheus/jmx_prometheus_javaagent-0.12.0.jar=8093:/opt/prometheus/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"的属性

With JMXTERM tool, i am able to see attributes for "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;

Confluent Connect 版本 - 5.4

Confluent Connect Version - 5.4

有什么建议可以解决上述问题吗?

Any suggestion to fix above issue?

推荐答案

貌似问题是connector-metric的属性类型是double,value是string.

Seems the problem is that the attribute type of connector-metric is double, but value is string.

这里是我如何获取状态指标的示例:

Here example how I get status metric:

# 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

这篇关于使用 Jmx Exporter for Prometheus 丢失 Confluent Kafka Connect Metrics的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆