-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Log errors from HotROD servers #769
Conversation
Signed-off-by: Yuri Shkuro <ys@uber.com>
server := driver.NewServer( | ||
net.JoinHostPort(driverOptions.serverInterface, strconv.Itoa(driverOptions.serverPort)), | ||
tracing.Init("driver", metricsFactory.Namespace("driver", nil), logger, jAgentHostPort), | ||
metricsFactory, | ||
logger, | ||
jAgentHostPort, | ||
) | ||
return server.Run() | ||
return logError(zapLogger, server.Run()) |
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.
Is it worth logging here and returning the same error? Will this lead to duplicate logs up the call stack? Maybe wrapping within another error makes more sense.
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 does lead to dup logs, but that's better than not getting logs at all, which would be the case since the all
command calls all servers except frontend
via go ...
, so returned errors go nowhere.
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.
Right. I meant we could improve the code to wrap the errors each time, but this is all sample code so I don't really mind.
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: Yuri Shkuro ys@uber.com