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

Add pass through of status message #83

Merged

Conversation

qnten
Copy link
Contributor

@qnten qnten commented Aug 4, 2020

When setting the the status of a span with span.SetStatus(codes.Unknown, "Error message"), the error message didn't get send to the server. This PR adds the status message to the grpc request if a message is given.

Copy link
Contributor

@james-bebbington james-bebbington left a comment

Choose a reason for hiding this comment

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

Looks good, thanks. Can you please also add a test for this?

Copy link
Contributor

@james-bebbington james-bebbington left a comment

Choose a reason for hiding this comment

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

Looks good - just one minor suggestion

sp.Status = &statuspb.Status{Code: int32(s.StatusCode), Message: s.StatusMessage}
}
if s.StatusCode == codes.OK && s.StatusMessage != "" {
sp.Status = &statuspb.Status{Code: int32(s.StatusCode), Message: s.StatusMessage}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this just be one condition to avoid the duplicated code:

if s.StatusCode != codes.OK || s.StatusMessage != "" {
	...
}

@james-bebbington james-bebbington merged commit 1e39e76 into GoogleCloudPlatform:master Aug 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants