Bird
0
0

Which of the following is the correct Prometheus scrape configuration snippet for a target at localhost:9090?

easy📝 Configuration Q3 of 15
Microservices - Monitoring and Observability
Which of the following is the correct Prometheus scrape configuration snippet for a target at localhost:9090?
Ascrape: job: 'local' targets: ['localhost:9090']
Bscrape_configs: - job_name: 'local' static_configs: - targets: ['localhost:9090']
Cjobs: - name: 'local' endpoints: ['localhost:9090']
Dscrape_configs: job: 'local' targets: ['localhost:9090']
Step-by-Step Solution
Solution:
  1. Step 1: Review Prometheus scrape config syntax

    Prometheus uses 'scrape_configs' with 'job_name' and 'static_configs' keys.
  2. Step 2: Match correct YAML structure

    scrape_configs: - job_name: 'local' static_configs: - targets: ['localhost:9090'] matches the correct structure with proper indentation and keys.
  3. Final Answer:

    Correct scrape configuration snippet -> Option B
  4. Quick Check:

    Scrape config syntax = scrape_configs: - job_name: 'local' static_configs: - targets: ['localhost:9090'] [OK]
Quick Trick: Use 'scrape_configs' with 'job_name' and 'static_configs' [OK]
Common Mistakes:
MISTAKES
  • Wrong YAML keys
  • Incorrect indentation
  • Missing 'static_configs' block

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Microservices Quizzes