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

OpenTelemetry span status code does not map directly to google.rpc.Code #143

Closed
Assignees
Labels
bug Something isn't working trace

Comments

@aabmass
Copy link
Contributor

aabmass commented Feb 10, 2021

Found a similar bug in JS and Python exporters (GoogleCloudPlatform/opentelemetry-operations-python#105)

Currently the code's int value is copied into the span pb if it's not Ok:

if s.StatusCode != codes.Ok {
sp.Status = &statuspb.Status{Code: int32(s.StatusCode), Message: s.StatusMessage}
}

This is fine when it's Ok, but the actual error code mapping doesn't make sense:

@aabmass aabmass added the trace label Feb 10, 2021
@aabmass aabmass changed the title OpenTelemetry span status code does not map directly to google.rcp.Code OpenTelemetry span status code does not map directly to google.rpc.Code Feb 12, 2021
@aabmass
Copy link
Contributor Author

aabmass commented Feb 12, 2021

Actually on second look, this is not right for Ok either:

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

codes.Ok is 2 which is UNKNOWN = 2 error in the proto

@punya punya added the bug Something isn't working label Feb 12, 2021
@jsuereth jsuereth self-assigned this Mar 5, 2021
@aabmass aabmass linked a pull request Mar 5, 2021 that will close this issue
This was referenced Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working trace
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants