Skip to main content
Version: v1.5.x

Monitoring Kafka-PromQL

Monitor Kafka by querying generic metrics data from Prometheus server using Prometheus PromQL. This approach is suitable when Prometheus is already monitoring Kafka and you need to fetch Kafka's monitoring data from Prometheus server.

Prerequisites

  1. Deploy Kafka.
  2. Deploy kafka_exporter.
  3. Collect monitoring metrics exposed by kafka_exporter through Prometheus.

Configuration Parameters

Parameter NameParameter Description
Monitoring HostIP, IPv6, or domain name of the target being monitored. Note ⚠️: Do not include protocol header (e.g., https://, http://).
Monitoring nameName to identify this monitoring, ensuring uniqueness of names.
PortPrometheus API port, default: 9090.
Relative pathRelative path of Prometheus to query PromQL, default: /api/v1/query
Request modeSet the request method for API calls: GET, POST, PUT, DELETE, default: GET
Enable HTTPSWhether to access the website via HTTPS, note ⚠️: enabling HTTPS generally requires changing the corresponding port to 443
UsernameUsername for Basic or Digest authentication when accessing the API.
PasswordPassword for Basic or Digest authentication when accessing the API.
Content-TypeResource type when carrying BODY request data.
Request BODYSet the BODY request data, effective for PUT and POST request methods.
Collection intervalInterval for periodic data collection in seconds, the minimum interval that can be set is 30 seconds
Description remarksAdditional remarks and descriptions for this monitoring. Users can add notes here.

Metrics Collection

Metric Set: kafka_brokers

Metric NameMetric UnitMetric help description
__name__NoneMetric name
instanceNoneInstance to which the metric belongs
timestampNoneTimestamp of metric collection
valueNoneMetric value

Metric Set: kafka_topic_partitions

Metric NameMetric UnitMetric help description
__name__NoneMetric name
instanceNoneInstance to which the metric belongs
timestampNoneTimestamp of metric collection
valueNoneMetric value

Metric Set: kafka_server_brokertopicmetrics_bytesinpersec

Metric NameMetric UnitMetric help description
__name__NoneMetric name
instanceNoneInstance to which the metric belongs
timestampNoneTimestamp of metric collection
valueNoneMetric value

Other Kafka Monitoring Methods Supported by HertzBeat

  1. If Kafka is enabled with JMX monitoring, you can use Kafka Monitoring.
  2. If Kafka cluster deploys kafka_exporter to expose monitoring metrics, you can refer to Prometheus task to configure the Prometheus collection task to monitor kafka.