prometheus / jmx_exporter

A process for exposing JMX Beans via HTTP for Prometheus consumption
Apache License 2.0
2.97k stars 1.19k forks source link

Unable to fetch kafka connector and task status metrics #713

Open khatribh opened 2 years ago

khatribh commented 2 years ago

Hi, I'm unable to fetch the kafka connector and task status metrics. I followed this issue, (https://github.com/prometheus/jmx_exporter/issues/633) and was still not able to get the connector status. I also followed the sample patterns to fetch the task status metrics but that didn't seem to work. Can anyone help me out? https://github.com/prometheus/jmx_exporter/blob/master/example_configs/kafka-connect.yml

khatribh commented 1 year ago

Can anyone help me out? Still facing this issue.

dhoard commented 1 year ago

Take a look at

https://github.com/confluentinc/jmx-monitoring-stacks/blob/7.2-post/shared-assets/jmx-exporter/kafka_connect.yml

timchenko-a commented 1 month ago

Mentioned one isn't working, I suspect this is due to the fact status is reported as a string, so not exposed correctly. In my case as a workaround I was able to set task value as a label and expose with static value:

  - pattern : "kafka.connect<type=connector-task-metrics, connector=(.+), task=(.+)><>status: (.*)"
    name: kafka_connect_connector_task_status
    value: 1
    labels:
      connector: $1
      task: $2
      status: $3
dhoard commented 1 month ago

For exposing a status string as a metric, this should work: https://www.robustperception.io/exposing-version-numbers-with-the-jmx-exporter/