0
0
Spring Bootframework~20 mins

Prometheus and Grafana integration concept in Spring Boot - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Prometheus and Grafana Integration Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
What is the primary role of Prometheus in monitoring a Spring Boot application?

Choose the best description of what Prometheus does when integrated with a Spring Boot app.

AIt deploys the Spring Boot application to the cloud.
BIt visualizes the metrics data using dashboards and charts.
CIt collects and stores metrics data from the application for analysis.
DIt automatically fixes performance issues detected in the app.
Attempts:
2 left
💡 Hint

Think about which tool is responsible for gathering data versus showing it.

💻 Command Output
intermediate
1:30remaining
What output does this Prometheus scrape config produce?

Given this Prometheus scrape configuration snippet, what is the target URL Prometheus will scrape?

Spring Boot
scrape_configs:
  - job_name: 'springboot-app'
    static_configs:
      - targets: ['localhost:8080']
APrometheus scrapes metrics from http://localhost:8080/metrics
BPrometheus scrapes metrics from http://localhost:8080/api/metrics
CPrometheus scrapes metrics from http://localhost:9090/metrics
DPrometheus scrapes metrics from http://localhost:8080/monitor
Attempts:
2 left
💡 Hint

Prometheus defaults to scraping the /metrics path unless overridden.

Configuration
advanced
1:30remaining
Which Spring Boot property enables Prometheus metrics endpoint?

Select the correct property to enable Prometheus metrics endpoint in application.properties.

Amanagement.endpoints.web.exposure.include=prometheus
Bspring.metrics.export.prometheus.enabled=false
Cmanagement.endpoint.prometheus.enabled=false
Dspring.boot.metrics.prometheus.endpoint=true
Attempts:
2 left
💡 Hint

Look for the property that exposes endpoints over web.

🔀 Workflow
advanced
2:00remaining
What is the correct order to integrate Prometheus and Grafana with Spring Boot?

Arrange these steps in the right order to set up monitoring with Prometheus and Grafana for a Spring Boot app.

A1,3,2,4
B3,1,2,4
C2,1,3,4
D1,2,3,4
Attempts:
2 left
💡 Hint

Think about enabling metrics first, then scraping, then visualization.

Troubleshoot
expert
2:00remaining
Why does Grafana show 'No data' for Spring Boot metrics despite Prometheus scraping successfully?

Prometheus scrapes Spring Boot metrics without errors, but Grafana dashboards show 'No data'. What is the most likely cause?

ASpring Boot metrics endpoint is disabled
BGrafana data source is not set to Prometheus or has wrong URL
CPrometheus scrape interval is too long
DGrafana dashboards are not refreshed automatically
Attempts:
2 left
💡 Hint

Check the connection between Grafana and Prometheus.