Bird
Raised Fist0

Which of the following is the correct Prometheus scrape configuration snippet to monitor Kafka metrics exposed at port 9090?

easy📝 Configuration Q12 of Q15
Kafka - Monitoring and Operations
Which of the following is the correct Prometheus scrape configuration snippet to monitor Kafka metrics exposed at port 9090?
A- job_name: 'kafka'\n static_configs:\n - targets: ['localhost:9090']
B- job_name: 'kafka'\n static_configs:\n - targets: ['localhost:2181']
C- job_name: 'kafka'\n static_configs:\n - targets: ['localhost:8080']
D- job_name: 'kafka'\n static_configs:\n - targets: ['localhost:1234']
Step-by-Step Solution
Solution:
  1. Step 1: Identify Kafka metrics port

    Kafka metrics exporter commonly exposes metrics on port 9090.
  2. Step 2: Match correct target in Prometheus config

    Only - job_name: 'kafka'\n static_configs:\n - targets: ['localhost:9090'] uses port 9090, which is correct for scraping Kafka metrics.
  3. Final Answer:

    - job_name: 'kafka'\n static_configs:\n - targets: ['localhost:9090'] -> Option A
  4. Quick Check:

    Port 9090 for Kafka metrics = A [OK]
Quick Trick: Kafka metrics usually on port 9090, check targets carefully [OK]
Common Mistakes:
MISTAKES
  • Using Kafka broker port 2181 (Zookeeper port) instead of metrics port
  • Confusing HTTP ports like 8080 for metrics
  • Using random ports not related to Kafka metrics

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes