google.golang.org/grpc/otelgrpc: Use canonical string status codes#8565
google.golang.org/grpc/otelgrpc: Use canonical string status codes#8565pellared merged 6 commits intoopen-telemetry:mainfrom
Conversation
dmathieu
left a comment
There was a problem hiding this comment.
This will need a changelog entry.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8565 +/- ##
=====================================
Coverage 82.1% 82.2%
=====================================
Files 179 179
Lines 13662 13700 +38
=====================================
+ Hits 11227 11265 +38
Misses 2033 2033
Partials 402 402
🚀 New features to boost your workflow:
|
|
There is also a failure from the linter |
Signed-off-by: Andrew Haines <haines@cerbos.dev>
| case grpc_codes.OK: | ||
| return "OK" | ||
| case grpc_codes.Canceled: | ||
| return "CANCELLED" |
There was a problem hiding this comment.
Should not this be spelled the same way as grpc_codes.Canceled? @haines
There was a problem hiding this comment.
The string representation of this error does have two L in the grpc spec.
https://github.com/grpc/grpc/blob/v1.75.0/doc/statuscodes.md
There was a problem hiding this comment.
And this is what is used as the canonical string internally in the Go gRPC implementation as well, unfortunately they named the constant using the alternate spelling which makes things confusing: https://github.com/grpc/grpc-go/blob/b71c26202050d6a6c528e42f96a2712baa74eb61/codes/code_string.go#L77
Fixes #8543