LOG_REQUEST_HEADERS (#5143)

# What this PR does

Adds a separate env variable for logging headers and sets it to false by
default.

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.
This commit is contained in:
Vadim Stepanov 2024-10-09 17:33:59 +01:00 committed by GitHub
parent bfcc0b9f29
commit aa8bee1971
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -384,7 +384,8 @@ MIDDLEWARE = [
"apps.user_management.middlewares.OrganizationDeletedMiddleware",
]
if OTEL_TRACING_ENABLED:
LOG_REQUEST_HEADERS = getenv_boolean("LOG_REQUEST_HEADERS", default=False)
if LOG_REQUEST_HEADERS:
MIDDLEWARE.insert(0, "engine.middlewares.LogRequestHeadersMiddleware")
LOG_REQUEST_ID_HEADER = "HTTP_X_CLOUD_TRACE_CONTEXT"