Repository navigation
Let callers override gRPC-code-to-zap-level mapping - #38
Merged
Merged
Conversation
Standard server's grpc_zap interceptor always maps codes.ResourceExhausted to Info with no way to override it, which is noisy for services doing admission control (e.g. substreams tier2 backpressure refusals). Callers can now supply their own code-to-level mapping via server.Options; default behavior (package Verbosity) is unchanged when unset.
maoueh
added a commit
to streamingfast/substreams
that referenced
this pull request
Sep 29, 2026
Cuts Cloud Logging volume on substreams-workers: these two log lines accounted for ~37% of sampled bytes on every backpressure refusal. Refusal rate/reason stays visible via substreams_tier2_rejected_request_counter. Bumps dgrpc to pick up server.WithCodeLevelFunc (streamingfast/dgrpc#38) and uses it to demote ResourceExhausted on tier2's gRPC server while keeping its default code-to-level mapping for every other code.
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.
server.WithCodeLevelFunc(func(codes.Code) zapcore.Level)option, consumed bydgrpc/server/standard'snewGRPCServerin place of the built-indefaultServerCodeLevelwhen set.standard.Verbosity) unchanged for every existing caller; this is opt-in per server instance.codes.ResourceExhaustedat Info on every backpressure refusal — a high-QPS, expected condition for services doing admission control. With this option a caller can demote just that code (or remap the whole table) without dgrpc hardcoding a demotion for everyone.