-
Notifications
You must be signed in to change notification settings - Fork 720
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
client/http: introduce caller ID into the HTTP client #7490
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #7490 +/- ##
==========================================
+ Coverage 74.31% 74.33% +0.02%
==========================================
Files 452 452
Lines 49918 49926 +8
==========================================
+ Hits 37097 37114 +17
+ Misses 9488 9479 -9
Partials 3333 3333
Flags with carried forward coverage won't be shown. Click here to find out more. |
Signed-off-by: JmPotato <ghzpotato@gmail.com>
7d4c49a
to
5b0fe23
Compare
Signed-off-by: JmPotato <ghzpotato@gmail.com>
d1b1e03
to
d320e72
Compare
Signed-off-by: JmPotato <ghzpotato@gmail.com>
d320e72
to
0091655
Compare
/merge |
@JmPotato: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
This pull request has been accepted and is ready to merge. Commit hash: 0091655
|
// Header key definition constants. | ||
const ( | ||
pdAllowFollowerHandleKey = "PD-Allow-Follower-Handle" | ||
componentSignatureKey = "component" |
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.
We can have a more intuitive name like 'CallerID', and it's a filed in http header, "X-Caller-ID" maybe a better name according HTTP RFC docs @JmPotato
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.
Using component
here is to reuse https://github.com/tikv/pd/blob/master/pkg/utils/requestutil/request_info.go#L52, but you're right about the naming, we could create a new filed to distinguish with it.
@@ -239,6 +267,8 @@ func (c *client) request( | |||
logFields := []zap.Field{ | |||
zap.String("name", name), | |||
zap.String("url", url), | |||
zap.String("method", method), | |||
zap.String("caller-id", c.callerID), |
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.
Do we log the caller id on the PD server side?
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.
It will appear in the audit log also.
What problem does this PR solve?
Issue Number: ref #7300.
What is changed and how does it work?
Check List
Tests
Release note