-
Notifications
You must be signed in to change notification settings - Fork 21
Update Django docs #109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Django docs #109
Conversation
Since the DockerflowMiddleware serves the health monitoring views, it is unneccessary to add them to urls.py
Add links to other documentation. Fix the signature of the callback function. Move so that the section is alpha-sorted. Fixup version callback
These logs should propagate up, so use more general logging level.
|
I decided to use |
|
Thanks @jwhitlock for the contribution 👏 We will have to postpone the review for a few days 🙏 |
leplatrem
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! TIL about traceparent, we could consider making it the default :)
docs/django.rst
Outdated
| The check setup process is logged at the ``DEBUG`` level. Since failure | ||
| details are omitted with ``DEBUG=False``, this logger should emit logs | ||
| at ``WARNING`` or ``ERROR`` level in production, so that the logs can | ||
| be used to diagnose heartbear failures. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| be used to diagnose heartbear failures. | |
| be used to diagnose heartbeat failures. |
docs/django.rst
Outdated
|
|
||
| A unique request ID is read from the ``X-Request-ID`` request header, and a UUID4 value is generated if unset. | ||
|
|
||
| Leveraging the ``RequestIdFilter`` in logging configuration as shown above will add a ``rid`` field into the ``Fields`` entry of all log messages. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I imagine that this should be RequestIdLogFilter here too
Unfortunately git grep RequestIdFilter other results :( We'll fix them in a follow-up (unless you want to do them as driveby)
|
Thanks @leplatrem, I've applied the changes, including
|
|
Thank you! |
This refreshes the Django docs, and adds some information that may be useful.
__version__,__heartbeat__and__lbheartbeat__views. In mozilla/fx-private-relay PR #4345, we removed some duplicate versions of the views that were not called because of the middleware.dockerflow.checks.register. This is how you can see what checks are failing ifDEBUG=False.DEBUG=False.dockerflowto the sample logging configuration. Without this (and without aroothandler), these logs are discarded, making it impossible to debug heartbeat issues.MIDDLEWARE_CLASSES, which was removed in Django 2.0 in 2017.SECURE_REDIRECT_EXEMPTfor Kubernetes deployments.DEBUG, to document how it affects what checks heartbeat runs, and the data included in the heartbeat response.DOCKERFLOW_HEARTBEAT_FAILED_STATUS_CODE, previously mentioned in the heartbeat view sectionDOCKERFLOW_REQUEST_ID_HEADER_NAME, previously mentioned in the "Requests Correlation ID" section. Add why you may want to change it for different deployment environments.DOCKERFLOW_SUMMARY_LOG_QUERYSTRING, previously mentioned in the Logging section.DOCKERFLOW_VERSION_CALLBACKdown to alphabetical orderSILENCED_SYSTEM_CHECKS, used but not previously documented.BASE_DIR, since there is no Django docs, because Django maintainers say that is a constant, not a setting (https://code.djangoproject.com/ticket/31387).