Bird
0
0

You want to monitor multiple Docker containers' CPU and memory usage in Grafana. Which setup step is essential before creating dashboards?

hard📝 Best Practice Q15 of 15
Docker - Logging and Monitoring
You want to monitor multiple Docker containers' CPU and memory usage in Grafana. Which setup step is essential before creating dashboards?
AConnect Grafana to a metrics data source like Prometheus collecting container stats
BInstall Grafana plugins inside each container
CRun Grafana with extra CPU and memory limits
DExpose all container ports to the host
Step-by-Step Solution
Solution:
  1. Step 1: Understand Grafana data source role

    Grafana itself does not collect metrics; it visualizes data from sources like Prometheus.
  2. Step 2: Set up Prometheus to scrape container metrics

    Prometheus collects CPU and memory stats from Docker containers and provides data to Grafana.
  3. Step 3: Connect Grafana to Prometheus

    Configure Grafana to use Prometheus as a data source to build dashboards.
  4. Final Answer:

    Connect Grafana to a metrics data source like Prometheus collecting container stats -> Option A
  5. Quick Check:

    Data source connection = Dashboard data [OK]
Quick Trick: Grafana needs data source like Prometheus first [OK]
Common Mistakes:
  • Thinking Grafana collects metrics alone
  • Installing plugins inside containers unnecessarily
  • Exposing all ports without reason

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes