Complete the code to expose Kafka metrics for Prometheus scraping.
metricsReporter = new [1]();The PrometheusReporter exposes Kafka metrics in a format Prometheus can scrape.
Complete the Prometheus scrape configuration to monitor Kafka metrics.
- job_name: 'kafka' static_configs: - targets: ['[1]']
Kafka Prometheus metrics are usually exposed on port 7071 by default.
Fix the error in the Grafana data source URL for Prometheus.
url = 'http://[1]/api/v1';
Grafana connects to Prometheus at port 9090, the default Prometheus port.
Complete the code to create a Prometheus alert rule for Kafka consumer lag.
alert: KafkaConsumerLagHigh expr: kafka_consumer_lag > [1] for: 5m
The expression checks if kafka_consumer_lag is greater than 1000. No extra operator is needed after the metric name.
Fill all three blanks to configure Kafka JMX exporter for Prometheus.
jmx_prometheus_javaagent=[1]=[2]:[3]
The JMX exporter jar is kafka-jmx-exporter.jar, running on localhost at port 7071.