grpc-go
grpc-go copied to clipboard
internal/xdsclient: xdsclient transport logs should indicate the authority
For more information, please refer to #6091 .
RELEASE NOTES: none
Optional: While you are there, it would be great if you could you also help cleanup these incorrect usages of logger
The write way would be by calling the xdsclient's logger -- which means you could get away with a simple
- logger.Warningf("Watch registered for name %q of type %q which is already registered", rType.TypeName(), resourceName)
+ c.logger.Warningf("Watch registered for name %q of type %q which is already registered", rType.TypeName(), resourceName)
Hi, @arvindbr8 ! Thanks for your advice! I have some opinions to the approach you suggested earlier.
internalgrpclog.NewPrefixLogger's first argument type isDepthLoggerV2, so we couldn't useNewPrefixLoggerlike you suggested without changing this API.- I have added the usage of
prefixLoggerAuthorityArgsatnewAuthoritymethod in authoriy.go because we want to confirm the information of management servers whenever we initiate an authority.
SG. Let me know when you want me to take another look at it.
Assigning it back to you @my4-dev. Seems like this might still be in progress. Let me know if you still have questions.
@arvindbr8 : Thank you for assigning back. I don't have any questions. If you or other member don't have any other suggestions or opinions after reviewing this PR, it would be ready to be merged.
sure. taking another look
Hi, @arvindbr8 !
The diff i suggested in my previous comment seems to checkout in my local. Is that a type mismatch error that you see?
I'm sorry, I tried again and could confirm that a type mismatch error didn't occur.
I might have tried with c.logger instead of logger🙏
I think that it is unnecessary to expose a new API (AddPrefix) to the preflixLogger too.
All the information required about the mgmt server should be available to you from the bootstrap config.
If we forget setting logger appropriately when we initiate authority by using newAuthority in other situation in the future, mgmt server information don't be outputted by logger.
Do we need to consider this situation?
Sorry for the delay. I was out of office. Taking a look now.
I dont think adding another prefix to our prefix logger would be the right way to go. Let me clone your repo and check the type error from my side.
Hi @my4-dev, Could you check this diff out. My idea to implement this would be along this diff.
On a high level, the logger that is passed to authority.go and transport.go needs to have the new prefix as per #6091. I dont believe adding a AddPrefix method is the right way to go about it. Please take a look and let me know if this PR can align more on those lines.
If you think its too much work, feel free to discard this PR and one of us could definitely take this up.
@arvindbr8 : I'm sorry, I want one of your team members to take this up🙇♂️