Docker - Logging and MonitoringWhat is the recommended architecture to monitor multiple Docker hosts with Prometheus and cAdvisor?AInstall Prometheus on each host and aggregate metrics manuallyBRun a single cAdvisor instance scraping all hosts remotelyCUse Prometheus pushgateway on each host to push metrics to a central PrometheusDDeploy cAdvisor on each host and configure Prometheus to scrape each host's cAdvisor endpointCheck Answer
Step-by-Step SolutionSolution:Step 1: Understand multi-host monitoringEach Docker host runs its own cAdvisor to expose local container metrics.Step 2: Prometheus scrapingPrometheus is configured to scrape each cAdvisor endpoint individually.Final Answer:Deploy cAdvisor on each host and configure Prometheus to scrape each host's cAdvisor endpoint -> Option DQuick Check:Central scraping of local exporters is best practice. [OK]Quick Trick: One cAdvisor per host, Prometheus scrapes all. [OK]Common Mistakes:Trying to scrape all hosts from a single cAdvisorUsing pushgateway incorrectly for container metrics
Master "Logging and Monitoring" in Docker9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Docker Quizzes Docker Security - User namespace remapping - Quiz 3easy Docker Security - Read-only filesystem containers - Quiz 10hard Docker Swarm - Service scaling - Quiz 12easy Docker Swarm - Why orchestration matters - Quiz 11easy Docker Swarm - Swarm vs Kubernetes decision - Quiz 8hard Docker in CI/CD - Deploying from CI/CD pipeline - Quiz 15hard Docker in CI/CD - GitLab CI with Docker - Quiz 1easy Image Optimization - Reducing image size strategies - Quiz 8hard Logging and Monitoring - Docker logging drivers - Quiz 10hard Production Patterns - Backup and restore strategies - Quiz 14medium