feat: enhance cookie monitoring and logging - #30027
Merged
Merged
Conversation
timmc-edx
reviewed
Mar 8, 2022
timmc-edx
reviewed
Mar 8, 2022
timmc-edx
reviewed
Mar 8, 2022
timmc-edx
reviewed
Mar 8, 2022
Contributor
Author
|
@timmc-edx: When parsing cookie logs, I found some issues. The new commit (64d1e2f) addresses some of them. I'll discuss the others separately. |
timmc-edx
approved these changes
Mar 9, 2022
robrap
force-pushed
the
robrap/ARCHBOM-2055-update-cookie-logging
branch
from
March 9, 2022 19:36
64d1e2f to
8fd3cb5
Compare
robrap
force-pushed
the
robrap/ARCHBOM-2055-update-cookie-logging
branch
from
March 9, 2022 21:43
8fd3cb5 to
0d210e0
Compare
timmc-edx
approved these changes
Mar 9, 2022
Contains a number of cookie monitoring changes. Enhancements: - Add sampling capability for cookie logging on headers smaller than the threshold. For details, see COOKIE_SAMPLING_REQUEST_COUNT. - Add cookie header size to log message. - Sort logged cookies starting with largest cookie. - Move logging from Middleware request processing to response processing to ensure the user id is available for logging for authenticated calls. - Added cookies.header.size.computed to check if there are any large hidden duplicate cookies. Can be compared against the cookies.header.size custom attribute. - Add delimiters into logs to make it simpler to parse when the logging tools accidentally exports multiple log lines together. Removed: - Legacy cookie capture code. This code was dangerous to to enable and provided more limited insight than the newer logging, so this was removed to simplify the code. Other refactors: - Switched Middleware to use new Django format, rather than the Mixin. - Moved tests to its own test class. Note: this middleware is likely to move to a separate library. ARCHBOM-2055
robrap
force-pushed
the
robrap/ARCHBOM-2055-update-cookie-logging
branch
from
March 10, 2022 01:39
b216817 to
29e5071
Compare
Contributor
|
EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production. |
Contributor
|
EdX Release Notice: This PR has been deployed to the production environment. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Contains a number of cookie monitoring changes.
Enhancements:
smaller than the threshold. For details, see
COOKIE_SAMPLING_REQUEST_COUNT.
to response processing to ensure the user id is
available for logging for authenticated calls.
if there are any large hidden duplicate cookies.
Can be compared against the cookies.header.size
custom attribute.
Removed:
to enable and provided more limited insight than the
newer logging, so this was removed to simplify the code.
Other refactors:
than the Mixin.
middleware is likely to move to a separate
library.
Supporting information
ARCHBOM-2055
Other information
Apologies that this is all in one commit, but it made my life much simpler. If it is too difficult for reviewing, we can discuss splitting this up.