Skip to content
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

Merged
merged 1 commit into from
Apr 10, 2018
Merged

Log errors from HotROD servers #769

merged 1 commit into from
Apr 10, 2018

Conversation

yurishkuro
Copy link
Member

Signed-off-by: Yuri Shkuro ys@uber.com

Signed-off-by: Yuri Shkuro <ys@uber.com>
@ghost ghost assigned yurishkuro Apr 10, 2018
@ghost ghost added the review label Apr 10, 2018
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())
Copy link
Contributor

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.

Copy link
Member Author

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.

Copy link
Contributor

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.

Copy link
Contributor

@isaachier isaachier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 218e93f on log-hotrod-errors into 1ae65e0 on master.

@yurishkuro yurishkuro merged commit 24fe987 into master Apr 10, 2018
@ghost ghost removed the review label Apr 10, 2018
@yurishkuro yurishkuro deleted the log-hotrod-errors branch April 10, 2018 19:33
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants