-
Notifications
You must be signed in to change notification settings - Fork 890
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
Use throttled logger and use error type in metrics client #2477
Conversation
case *serviceerror.ResourceExhausted: | ||
return ErrorTypeResourceExhausted | ||
default: | ||
return ErrorTypeUnknown |
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 are we going to be able to use this? The idea of this error type tag with throttled logger is we can filter on the error type in logging to see what is happening.
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 think we should return fmt.Sprintf("%T", err)
c.throttledLogger.Error("history client encountered error", tag.Error(err)) | ||
scope.Tagged(metrics.ServiceErrorTypeTag(err)).IncCounter(metrics.ClientFailures) |
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 should add field for error type to the log line that is the same as the tag on metrics so when we observer some error type from metrics, we can filter on log for that type.
client historyservice.HistoryServiceClient | ||
metricsClient metrics.Client | ||
logger log.Logger | ||
throttledLogger log.Logger |
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.
might be worth moving resource.ThrottledLogger
to log package and use this type instead
What changed?
Use throttled logger and use error type in metrics client
Why?
The logger and metrics may be noisy to identify issues.
How did you test it?
Added unit tests
Potential risks
Is hotfix candidate?