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
Fix request id key #197
Fix request id key #197
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,8 @@ import ( | |
// DefaultRequestIDKey is the metadata key name for request ID | ||
const ( | ||
DeprecatedRequestIDKey = "Request-Id" | ||
DefaultRequestIDKey = "request_id" | ||
DefaultRequestIDKey = "X-Request-ID" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note that this is already implemented in the ingress-controller: But not forwarded to identity: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kd7lxl, please avoid references to data from private repos in public repositories There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kd7lxl We probably can forward it, it a good point There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. broke authz middleware as well https://github.com/Infoblox-CTO/ngp.authz.middleware/pull/23/files#diff-320a504f903c9c37cd1c4852412110f8R216 |
||
RequestIDLogKey = "request_id" | ||
) | ||
|
||
// HandleRequestID either extracts a existing and valid request ID from the context or generates a new one | ||
|
@@ -51,5 +52,5 @@ func NewContext(ctx context.Context, reqID string) context.Context { | |
} | ||
|
||
func addRequestIDToLogger(ctx context.Context, reqID string) { | ||
ctxlogrus.AddFields(ctx, logrus.Fields{DefaultRequestIDKey: reqID}) | ||
ctxlogrus.AddFields(ctx, logrus.Fields{RequestIDLogKey: reqID}) | ||
} |
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.
Please add a case that looks for
DeprecatedRequestIDKey
so we can verify backwards compatibility.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.
Good point, did it