Bird
0
0

You created a ServiceMonitor but Prometheus is not scraping metrics from your service. Which of these is a likely cause?

medium📝 Troubleshoot Q14 of 15
Kubernetes - Monitoring and Logging
You created a ServiceMonitor but Prometheus is not scraping metrics from your service. Which of these is a likely cause?
AThe ServiceMonitor selector labels do not match the service labels
BThe Prometheus server is not running on the cluster
CThe service port is not exposed in the ServiceMonitor endpoints
DAll of the above
Step-by-Step Solution
Solution:
  1. Step 1: Check label matching

    If ServiceMonitor selector labels don't match service labels, Prometheus won't find the service.
  2. Step 2: Verify Prometheus server status and endpoint config

    Prometheus must be running and the service port must be correctly specified in endpoints to scrape metrics.
  3. Final Answer:

    All of the above -> Option D
  4. Quick Check:

    Any mismatch or missing config stops scraping [OK]
Quick Trick: Check labels, server status, and endpoints all match [OK]
Common Mistakes:
  • Only checking one cause and ignoring others
  • Assuming Prometheus always runs by default
  • Forgetting to expose correct port in ServiceMonitor

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes