Skip to content

Cherry-pick #9081 into v1.81.x#9102

Merged
mbissa merged 2 commits into
grpc:v1.81.xfrom
mbissa:v1.81.x
May 4, 2026
Merged

Cherry-pick #9081 into v1.81.x#9102
mbissa merged 2 commits into
grpc:v1.81.xfrom
mbissa:v1.81.x

Conversation

@mbissa

@mbissa mbissa commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Original PR: #9081

RELEASE NOTES:

  • otel: Segregate client and server RPCInfo used for metrics and traces.

…grpc#9081)

Fixes grpc#9053 
Client and Server metrics and traces handling code during RPC was using
the same RPCInfo. This lead to overwriting of context when an
application was acting as server and then initiating other grpc call as
a client. This PR segregates the rpcInfoKey context key into
clientRPCInfoKey and serverRPCInfoKey so that it is not
reused/overwritten between server and client code.

RELEASE NOTES:
* otel: Segregate client and server RPCInfo used for metrics and traces.
@mbissa mbissa added this to the 1.81 Release milestone Apr 29, 2026
@mbissa mbissa requested a review from arjan-bal April 29, 2026 06:26
@codecov

codecov Bot commented Apr 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.23529% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.29%. Comparing base (c45fae6) to head (a6f04d7).
⚠️ Report is 1 commits behind head on v1.81.x.

Files with missing lines Patch % Lines
stats/opentelemetry/client_metrics.go 60.00% 0 Missing and 2 partials ⚠️
stats/opentelemetry/opentelemetry.go 88.23% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           v1.81.x    #9102      +/-   ##
===========================================
- Coverage    82.56%   82.29%   -0.27%     
===========================================
  Files          413      413              
  Lines        33475    33507      +32     
===========================================
- Hits         27637    27576      -61     
- Misses        4259     4286      +27     
- Partials      1579     1645      +66     
Files with missing lines Coverage Δ
stats/opentelemetry/client_tracing.go 89.09% <100.00%> (ø)
stats/opentelemetry/server_metrics.go 76.98% <100.00%> (-11.02%) ⬇️
stats/opentelemetry/server_tracing.go 76.00% <100.00%> (ø)
stats/opentelemetry/client_metrics.go 73.50% <60.00%> (-15.46%) ⬇️
stats/opentelemetry/opentelemetry.go 57.32% <88.23%> (-19.76%) ⬇️

... and 19 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mbissa mbissa changed the title otel: Segregate client and server RPCInfo used for metrics and traces… Cherry-pick #9081 into v1.81.x Apr 29, 2026
@arjan-bal

Copy link
Copy Markdown
Contributor

We should hold off until we release 1.81.0 since we haven't tested this change in google3 yet.

@arjan-bal arjan-bal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@mbissa mbissa merged commit b33c29e into grpc:v1.81.x May 4, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants