Bird
0
0

You want to monitor both error rates and response times in your Django app using Prometheus. Which setup step is essential to achieve this?

hard📝 Workflow Q8 of 15
Django - Deployment and Production
You want to monitor both error rates and response times in your Django app using Prometheus. Which setup step is essential to achieve this?
AUse Sentry only for error tracking without Prometheus
BConfigure Django to send logs to a file only
CDisable Django's built-in logging to avoid conflicts
DAdd Prometheus middleware to collect metrics and expose /metrics endpoint
Step-by-Step Solution
Solution:
  1. Step 1: Understand Prometheus monitoring requirements

    Prometheus collects metrics by scraping an HTTP endpoint that exposes metrics data.
  2. Step 2: Apply to Django setup

    Adding Prometheus middleware collects metrics like response times and error counts, and exposing /metrics endpoint allows Prometheus to scrape data.
  3. Final Answer:

    Add Prometheus middleware to collect metrics and expose /metrics endpoint -> Option D
  4. Quick Check:

    Prometheus needs middleware and /metrics endpoint [OK]
Quick Trick: Expose /metrics endpoint for Prometheus scraping [OK]
Common Mistakes:
MISTAKES
  • Thinking logs alone provide Prometheus metrics
  • Using only Sentry without Prometheus for metrics
  • Disabling logging unnecessarily

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Django Quizzes