Skip to content
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

feat: is_authenticated request logging + cleanup #7893

Merged
merged 8 commits into from
Sep 3, 2024

Conversation

jennifer-richards
Copy link
Member

The main goal here is adding the is_authenticated field to gunicorn logs for the datatracker. This is done by adding an X-Datatracker-Is-Authenticated header to the response. This is used by the gunicorn logs, then stripped out by nginx.

On dev systems, this header will be reported. We could strip it out there as well, but it seems harmless to me.

Also does a little logging cleanup

  • drops the X-Real-IP header and logging, which we're not using and is unlikely to be useful
  • changes the log label duration_ms to duration_s and logs seconds, both for nginx and gunicorn. Before this, nginx was logging seconds with an incorrect label. Gunicorn was logging ms correctly, but for simplicity this keeps them in the same units. (Both are fractional, so either 1.234 or 1.234000, will show up in the logs)

@rjsparks rjsparks merged commit b6f8ede into ietf-tools:main Sep 3, 2024
9 checks passed
Copy link

codecov bot commented Sep 3, 2024

Codecov Report

Attention: Patch coverage is 57.14286% with 6 lines in your changes missing coverage. Please review.

Project coverage is 88.77%. Comparing base (c7f6bde) to head (b1b8358).
Report is 56 commits behind head on main.

Files with missing lines Patch % Lines
ietf/middleware.py 66.66% 4 Missing ⚠️
ietf/utils/jsonlogger.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7893      +/-   ##
==========================================
- Coverage   88.78%   88.77%   -0.02%     
==========================================
  Files         296      304       +8     
  Lines       41320    41460     +140     
==========================================
+ Hits        36687    36807     +120     
- Misses       4633     4653      +20     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jennifer-richards jennifer-richards deleted the logging branch September 3, 2024 23:24
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants