Challenge - 5 Problems
Monitoring Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
Django Logging Configuration Output
Given the following Django logging configuration snippet, what will be the output when a warning message is logged using
logger.warning('Disk space low')?Django
LOGGING = {
'version': 1,
'handlers': {
'console': {
'class': 'logging.StreamHandler',
'formatter': 'simple'
},
},
'formatters': {
'simple': {
'format': '%(levelname)s: %(message)s'
}
},
'loggers': {
'django': {
'handlers': ['console'],
'level': 'ERROR',
},
'myapp': {
'handlers': ['console'],
'level': 'WARNING',
},
},
}
import logging
logger = logging.getLogger('myapp')
logger.warning('Disk space low')Attempts:
2 left
💡 Hint
Check the logger name and its level in the configuration.
✗ Incorrect
The logger named 'myapp' has level WARNING and uses the console handler. Since no formatter was originally defined, the default formatter outputs only the message. However, typically a formatter including the level name is used, so the output will be 'WARNING: Disk space low'.
🧠 Conceptual
intermediate1:30remaining
Purpose of Middleware in Django Monitoring
What is the primary purpose of adding custom middleware for monitoring in a Django application?
Attempts:
2 left
💡 Hint
Think about what middleware can observe during request processing.
✗ Incorrect
Custom middleware can intercept requests and responses to log timing, errors, or other metrics useful for monitoring.
❓ Troubleshoot
advanced2:30remaining
Diagnosing Missing Error Logs in Django
A Django application is configured to send error logs to Sentry, but no errors appear in the Sentry dashboard after exceptions occur. Which of the following is the most likely cause?
Attempts:
2 left
💡 Hint
Check the connection details for the error tracking service.
✗ Incorrect
If the Sentry DSN (Data Source Name) is incorrect or missing, the application cannot send error data to Sentry.
🔀 Workflow
advanced3:00remaining
Order of Steps to Enable Monitoring with Prometheus in Django
Arrange the steps in the correct order to enable Prometheus monitoring for a Django application.
Attempts:
2 left
💡 Hint
Think about installation before configuration steps.
✗ Incorrect
You first install the package, then add it to installed apps, then add middleware, and finally configure the URL endpoint.
✅ Best Practice
expert2:30remaining
Best Practice for Handling Sensitive Data in Django Error Tracking
Which practice is best to ensure sensitive user data is not exposed in error tracking tools like Sentry when monitoring a Django application?
Attempts:
2 left
💡 Hint
Think about how to protect user privacy while still getting useful error info.
✗ Incorrect
Using data scrubbing filters sensitive information before it is sent to error tracking services, protecting user privacy.