Skip to content

fix(wrap): extend generated gRPC histogram buckets to 3 minutes#79

Open
aryanmehrotra wants to merge 1 commit into
mainfrom
fix/grpc-histogram-buckets
Open

fix(wrap): extend generated gRPC histogram buckets to 3 minutes#79
aryanmehrotra wants to merge 1 commit into
mainfrom
fix/grpc-histogram-buckets

Conversation

@aryanmehrotra

Copy link
Copy Markdown
Member

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 at 10 (ms). Any RPC slower than 10ms fell into the +Inf bucket, so the histogram carried no usable distribution above that point.

This extends the generated gRPCBuckets (both the server-side and client-side templates in wrap/template.go) up to 180000 (3 minutes), keeping the existing fine-grained low end (0.00510).

gRPC duration is recorded in fractional milliseconds (durationMs in gofr's pkg/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 EDIT examples), 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.

Copilot AI review requested due to automatic review settings June 10, 2026 03:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.
@aryanmehrotra aryanmehrotra force-pushed the fix/grpc-histogram-buckets branch from 770be60 to 2735cab Compare June 10, 2026 04:40
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.

2 participants