fix(wrap): extend generated gRPC histogram buckets to 3 minutes#79
Open
aryanmehrotra wants to merge 1 commit into
Open
fix(wrap): extend generated gRPC histogram buckets to 3 minutes#79aryanmehrotra wants to merge 1 commit into
aryanmehrotra wants to merge 1 commit into
Conversation
The generated gRPC latency histograms (app_gRPC-Server_stats, app_gRPC-Stream_stats, app_gRPC-Client_stats) capped their buckets at 10ms, so any RPC slower than 10ms fell into +Inf and the histogram carried no usable distribution above that point. Extend the bucket range up to 180000 (3 minutes), keeping the existing fine-grained low end. gRPC duration is recorded in fractional milliseconds, so the buckets stay in milliseconds and the existing descriptions remain correct.
770be60 to
2735cab
Compare
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.
What
The gRPC latency histograms emitted by
gofr wrap grpc(app_gRPC-Server_stats,app_gRPC-Stream_stats,app_gRPC-Client_stats) capped their buckets at10(ms). Any RPC slower than 10ms fell into the+Infbucket, so the histogram carried no usable distribution above that point.This extends the generated
gRPCBuckets(both the server-side and client-side templates inwrap/template.go) up to180000(3 minutes), keeping the existing fine-grained low end (0.005…10).gRPC duration is recorded in fractional milliseconds (
durationMsin gofr'spkg/gofr/grpc), so the buckets remain in milliseconds and the existing"... in milliseconds."descriptions stay correct — only the range grows.Why now
Companion to gofr-dev/gofr#3568, which extends all datasource latency histograms to 3 minutes. gRPC histograms are generated by this CLI (the gofr repo only ships generated
// DO NOT EDITexamples), so the fix belongs here.Compatibility
No recorded values change; only histogram bucket boundaries are added. Existing services pick up the new buckets when they regenerate their gRPC wrappers.
Note
Regenerate the committed gRPC examples in the gofr repo (or let them be regenerated) so they reflect the new buckets.