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

gRPC span status does not match OTel specification #9637

Closed
ccorbacho opened this issue Oct 9, 2023 · 0 comments · Fixed by #9641
Closed

gRPC span status does not match OTel specification #9637

ccorbacho opened this issue Oct 9, 2023 · 0 comments · Fixed by #9641
Labels
bug Something isn't working

Comments

@ccorbacho
Copy link

Describe the bug

See:

The OpenTelemetry gRPC specification for server spans was updated in July 2023 so that certain responses are no longer considered errors - e.g. NOT_FOUND is no longer considered an error (to bring this in line with how 404 in HTTP is not considered an error).

However, this is not reflected in the current instrumentation code.

The current code is just taking whatever grpc-java considers an error, and setting the status to error based on that:
https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/2eba523c004c8db52850f74e118f20374a0e86f1/instrumentation/grpc-1.6/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_6/GrpcSpanStatusExtractor.java#L31C12-L31C18

The problem is that if you look at what grpc-java is doing, you can see that it considers anything that isn't status "OK" as an error, which does not match the spec:
https://github.com/grpc/grpc-java/blob/master/api/src/main/java/io/grpc/Status.java#L520

Steps to reproduce

Trigger a NOT_FOUND response on a gRPC call.

Expected behavior

The span status is not set as error.

Actual behavior

The span status is marked as error.

Javaagent or library instrumentation version

1.31.0

Environment

No response

Additional context

No response

@ccorbacho ccorbacho added bug Something isn't working needs triage New issue that requires triage labels Oct 9, 2023
@mateuszrzeszutek mateuszrzeszutek removed the needs triage New issue that requires triage label Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants