Request-ID based logging + structured JSON logging defaults #48
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lab/authz-bridge#48
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The bridge's serving paths (the gRPC ext_authz OIDC and Exchange Check services, the plain-HTTP callback/logout listener) log without any per-request correlation ID. A single Check or callback can emit several log lines (e.g.
No App resolved for the Hostplus the deny, or a bearer validation failure), and with concurrent requests interleaved there is no way to group the lines belonging to one request.Separately, the manager defaults to the zap development encoder (
Development: trueincmd/main.go) — console output. In the cluster we want structured JSON logs by default.Plan
x-request-idmetadata key and generates one (16 random bytes, base64url) when absent. The ID is carried on the request context logger and echoed back in the response metadata.X-Request-Idheader, generates one when absent, sets it on the response, and carries it on the request context logger.requestIDkey, so every existinglogf.FromContext(ctx)line in the flows picks it up without call-site changes.zap.Options{Development: false}(JSON encoder, Info level, stacktraces on errors).--zap-develstill switches to the console development encoder for local use.