feat(grpc-storage): Add max_recv_msg_size_mib config for gRPC storage client#8576
Merged
Conversation
… client The gRPC default client receive limit is 4 MiB. When a storage backend returns large traces this results in: grpc: received message larger than max (N vs. 4194304) OTel's configgrpc.ClientConfig does not expose a client-side receive size limit (only ServerConfig has max_recv_msg_size_mib), so we add it directly to the gRPC storage Config and wire it via grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(...)). Closes jaegertracing#7670 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Yuri Shkuro <github@ysh.us>
jaegertracingbot
approved these changes
May 14, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a gRPC storage client configuration knob to raise the default 4 MiB receive-message limit, preventing ResourceExhausted errors when backends return large trace payloads.
Changes:
- Introduces
max_recv_msg_size_mibin the gRPC storageConfig. - Wires the setting into the gRPC dial via
grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(...)). - Adds basic tests covering default behavior and presence of the added dial option.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| internal/storage/v2/grpc/factory.go | Appends a default call option to increase max receive message size when configured. |
| internal/storage/v2/grpc/config.go | Adds MaxRecvMsgSizeMiB to the storage gRPC client configuration. |
| internal/storage/v2/grpc/factory_test.go | Adds a unit test intended to verify the dial option is added when configured. |
| internal/storage/v2/grpc/config_test.go | Asserts the default config leaves the new setting unset (uses gRPC default). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…sage size On 32-bit platforms int is 32 bits, so MaxRecvMsgSizeMiB*1024*1024 overflows for values >= 2048. Compute in int64 and clamp to math.MaxInt before passing to grpc.MaxCallRecvMsgSize(int). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Yuri Shkuro <github@ysh.us>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8576 +/- ##
=======================================
Coverage 96.56% 96.56%
=======================================
Files 330 330
Lines 17356 17363 +7
=======================================
+ Hits 16759 16766 +7
Misses 450 450
Partials 147 147
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
A negative value silently passes the > 0 guard and falls through with the gRPC default, giving the user no indication of misconfiguration. Reject it explicitly at factory creation time. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Yuri Shkuro <github@ysh.us>
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.
The gRPC default client receive limit is 4 MiB. When a storage backend returns large traces this results in:
OTel's configgrpc.ClientConfig does not expose a client-side receive size limit (only ServerConfig has max_recv_msg_size_mib), so we add it directly to the gRPC storage Config and wire it via
grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(...)).Closes #7670
AI Usage in this PR (choose one)