-
Notifications
You must be signed in to change notification settings - Fork 233
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
pdclient: Add caller info to pd client #1516
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: okJiang <[email protected]>
2533e17
to
785a707
Compare
/retest |
1 similar comment
/retest |
Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
internal/locate/pd_codec.go
Outdated
@@ -71,7 +72,7 @@ func NewCodecPDClientWithKeyspace(mode apicodec.Mode, client pd.Client, keyspace | |||
return nil, err | |||
} | |||
|
|||
return &CodecPDClient{client, codec}, nil | |||
return &CodecPDClient{client.WithCallerComponent("codec-pd-client"), codec}, nil |
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.
Should we also extract this as a constant to reuse it in line 61?
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.
LGTM
Signed-off-by: okJiang <[email protected]>
@@ -285,7 +285,7 @@ func NewKVStore(uuid string, pdClient pd.Client, spkv SafePointKV, tikvclient Cl | |||
clusterID: pdClient.GetClusterID(context.TODO()), | |||
uuid: uuid, | |||
oracle: o, | |||
pdClient: pdClient, | |||
pdClient: pdClient.WithCallerComponent("kv-store"), |
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.
How about defining and describing one enum not using string?
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.
How about defining them in pd repo? If you agree, I can open a pr to do it.
@@ -64,6 +65,10 @@ type InterceptedPDClient struct { | |||
pd.Client | |||
} | |||
|
|||
func NewInterceptedPDClient(client pd.Client) *InterceptedPDClient { |
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.
needs comment for public.
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.
rest lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bufferflies The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
ref tikv/pd#8593