Challenge - 5 Problems
Prometheus Docker Monitoring Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
Prometheus Docker container startup output
You run the following command to start Prometheus in Docker with a custom configuration file. What is the expected output in the Docker logs indicating Prometheus started successfully?
Docker
docker run -d --name prometheus -p 9090:9090 -v /home/user/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus
Attempts:
2 left
💡 Hint
Look for a log message that confirms Prometheus started without errors.
✗ Incorrect
When Prometheus starts successfully, it logs an info level message with 'Starting Prometheus'. Errors about config file or port binding indicate startup failure.
❓ Configuration
intermediate2:00remaining
Prometheus scrape config for Docker containers
Which Prometheus scrape configuration snippet correctly scrapes metrics from Docker containers exposing metrics on port 9100?
Attempts:
2 left
💡 Hint
Docker service discovery uses the Docker socket and port configuration.
✗ Incorrect
Option B uses docker_sd_configs with the Docker socket and port 9100, which is the correct way to discover Docker containers exposing metrics.
❓ Troubleshoot
advanced2:00remaining
Prometheus cannot scrape Docker container metrics
You configured Prometheus to scrape Docker containers on port 9100, but no metrics appear in Prometheus UI. Which is the most likely cause?
Attempts:
2 left
💡 Hint
Prometheus needs permission to access Docker socket for service discovery.
✗ Incorrect
Without access to the Docker socket, Prometheus cannot discover containers to scrape metrics from, even if containers expose metrics correctly.
🔀 Workflow
advanced3:00remaining
Steps to monitor Docker containers with Prometheus
What is the correct order of steps to set up Prometheus monitoring for Docker containers exposing metrics on port 9100?
Attempts:
2 left
💡 Hint
Think about starting containers first, then Prometheus, then configuration, then verification.
✗ Incorrect
You must first run containers exposing metrics, then start Prometheus with access to Docker socket, configure scraping, and finally verify in UI.
✅ Best Practice
expert3:00remaining
Best practice for Prometheus Docker monitoring security
Which option is the best practice to securely run Prometheus monitoring Docker containers without exposing the Docker socket to Prometheus container?
Attempts:
2 left
💡 Hint
Consider isolation and minimal permissions for security.
✗ Incorrect
Using a sidecar exporter per container avoids giving Prometheus direct access to the Docker socket, improving security by isolating permissions.