You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
The text was updated successfully, but these errors were encountered: