Skip to content

google.golang.org/grpc/otelgrpc: Use canonical string status codes#8565

Merged
pellared merged 6 commits intoopen-telemetry:mainfrom
haines:otelgrpc-canonical-status
Mar 2, 2026
Merged

google.golang.org/grpc/otelgrpc: Use canonical string status codes#8565
pellared merged 6 commits intoopen-telemetry:mainfrom
haines:otelgrpc-canonical-status

Conversation

@haines
Copy link
Copy Markdown
Contributor

@haines haines commented Feb 16, 2026

Fixes #8543

@haines haines requested review from a team and dashpole as code owners February 16, 2026 17:51
Copy link
Copy Markdown
Member

@dmathieu dmathieu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need a changelog entry.

Comment thread instrumentation/google.golang.org/grpc/otelgrpc/stats_handler.go
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.2%. Comparing base (8096a3e) to head (00d0d0c).
⚠️ Report is 100 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@          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           
Files with missing lines Coverage Δ
...n/google.golang.org/grpc/otelgrpc/stats_handler.go 98.6% <100.0%> (+0.2%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pellared
Copy link
Copy Markdown
Member

There is also a failure from the linter

@haines haines requested a review from dmathieu February 17, 2026 13:25
Comment thread instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go
@haines haines requested a review from dmathieu February 18, 2026 09:13
@pellared pellared merged commit e81a2b4 into open-telemetry:main Mar 2, 2026
34 of 35 checks passed
@MrAlias MrAlias added this to the v1.41.0 milestone Mar 2, 2026
@haines haines deleted the otelgrpc-canonical-status branch March 9, 2026 12:41
haines added a commit to cerbos/cerbos-sdk-javascript that referenced this pull request Mar 9, 2026
Signed-off-by: Andrew Haines <haines@cerbos.dev>
case grpc_codes.OK:
return "OK"
case grpc_codes.Canceled:
return "CANCELLED"
Copy link
Copy Markdown

@bincyber bincyber Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should not this be spelled the same way as grpc_codes.Canceled? @haines

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: otelgrpc uses PascalCase status codes, spec uses SCREAMING_SNAKE_CASE

6 participants