fix(otelgrpc): use SCREAMING_SNAKE_CASE for rpc.response.status_code attribute https://github.com/open-telemetry/opentelemetry-go-contrib/issues/8543#8575
Closed
anayagam wants to merge 1 commit into
Conversation
New grpcCodeString(c grpc_codes.Code) string function with a full switch over all 17 gRPC codes returning SCREAMING_SNAKE_CASE strings Lines 374/376: replaced s.Code().String() / grpc_codes.OK.String() with grpcCodeString(s.Code()) / grpcCodeString(grpc_codes.OK) stats_handlertest_test.go — Added a local grpcCodeToString() mirror function (needed since the production function is unexported) and updated assertServerSpan and assertStatsHandlerServerMetrics to use it. grpc_stats_handler_test.go — Replaced all codes.OK.String() with the literal "OK" string. Added a Fixed entry referencing issue open-telemetry#8543. Key mapping note: grpc_codes.Canceled → "CANCELLED" (note the double-L) , this matches the gRPC/OTel spec spelling.
|
Member
|
Duplicate of #8565 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
— Added a local grpcCodeToString() mirror function (needed since the production function is unexported) and updated assertServerSpan and assertStatsHandlerServerMetrics to use it. grpc_stats_handler_test.go
— Replaced all codes.OK.String() with the literal "OK" string. Added a Fixed entry referencing issue [Bug]:
otelgrpcuses PascalCase status codes, spec uses SCREAMING_SNAKE_CASE #8543.