-
Notifications
You must be signed in to change notification settings - Fork 917
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
Reduce unnecessary log noise #3918
Conversation
// this should not happen, log warn and move on | ||
i.logger.Warn(fmt.Sprintf("RedirectionInterceptor encountered unknown API: %v", methodName)) | ||
// this should not happen for frontend APIs but ok for admin and other future handlers | ||
// log warn and move on |
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.
nit: update comment
@@ -177,8 +177,9 @@ func (i *RedirectionInterceptor) Intercept( | |||
return i.handleRedirectAPIInvocation(ctx, req, info, handler, methodName, respAllocFn, namespaceName) | |||
} | |||
|
|||
// this should not happen, log warn and move on | |||
i.logger.Warn(fmt.Sprintf("RedirectionInterceptor encountered unknown API: %v", methodName)) | |||
// this should not happen for frontend APIs but ok for admin and other future handlers |
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.
You can get the service name from info.FullMethod and log at Warn level for WorkflowService, and Debug level for AdminService or others. That might be more useful to catch bugs
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.
all workflow service APIs are validated
i.logger.Warn(fmt.Sprintf("RedirectionInterceptor encountered unknown API: %v", methodName)) | ||
// this should not happen for frontend APIs but ok for admin and other future handlers | ||
// log warn and move on | ||
i.logger.Debug(fmt.Sprintf("RedirectionInterceptor encountered unknown API: %v", methodName)) |
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.
i.logger.Debug(fmt.Sprintf("RedirectionInterceptor encountered unknown API: %v", methodName)) | |
i.logger.Debug("RedirectionInterceptor encountered unknown API", tag.Name(info.FullMethod)) |
I'd rather see the full name to know what service it's in
// this should not happen, log warn and move on | ||
i.logger.Warn(fmt.Sprintf("RedirectionInterceptor encountered unknown API: %v", methodName)) | ||
// this should not happen for frontend APIs but ok for admin and other future handlers | ||
i.logger.Debug(fmt.Sprintf("RedirectionInterceptor encountered unknown API: %v", info.FullMethod)) |
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.
I'd still rather use tags.. this is going to actually fmt.Sprintf on every non-workflowservice rpc, right?
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.
yes, and not only for admin but for operator also.
What changed?
Why?
admin handler & other future handler does not need redirection, reduce unnecessary noise
How did you test it?
N/A
Potential risks
N/A
Is hotfix candidate?
N/A