Bird
0
0

You want to monitor container resource usage and send alerts if CPU usage exceeds 80%. Which approach best fits this goal?

hard📝 Best Practice Q15 of 15
Docker - Logging and Monitoring
You want to monitor container resource usage and send alerts if CPU usage exceeds 80%. Which approach best fits this goal?
ASet up automated monitoring with tools like Prometheus and alert rules
BRestart containers frequently to avoid high CPU
CUse <code>docker stats</code> manually and check CPU usage occasionally
DIncrease container memory limits to reduce CPU usage
Step-by-Step Solution
Solution:
  1. Step 1: Understand manual vs automated monitoring

    Manual checks are unreliable and slow for alerts.
  2. Step 2: Identify best practice for alerting

    Automated tools like Prometheus collect metrics and trigger alerts automatically.
  3. Step 3: Evaluate other options

    Restarting containers or increasing memory does not guarantee CPU stays below threshold.
  4. Final Answer:

    Set up automated monitoring with tools like Prometheus and alert rules -> Option A
  5. Quick Check:

    Automated monitoring + alerts = best practice [OK]
Quick Trick: Use monitoring tools with alerting, not manual checks [OK]
Common Mistakes:
  • Relying on manual docker stats checks
  • Restarting containers without root cause analysis
  • Assuming more memory fixes CPU spikes

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes