Skip to content

Commit

Permalink
Merge pull request #2102 from bison/native-histograms
Browse files Browse the repository at this point in the history
Enable native histograms in server latency metrics
  • Loading branch information
josephschorr authored Nov 1, 2024
2 parents eef3c2f + 8e5ac70 commit 51edc2d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/cmd/server/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,13 @@ func createServerMetrics(disableHistogram bool) (grpc.UnaryServerInterceptor, gr
var opts []grpcprom.ServerMetricsOption
if !disableHistogram {
opts = append(opts, grpcprom.WithServerHandlingTimeHistogram(
grpcprom.WithHistogramBuckets([]float64{.001, .003, .006, .010, .018, .024, .032, .042, .056, .075, .100, .178, .316, .562, 1, 5}),
grpcprom.WithHistogramOpts(&prometheus.HistogramOpts{
NativeHistogramBucketFactor: 1.1, // At most 10% increase from bucket to bucket.
NativeHistogramMaxBucketNumber: 100,
Buckets: []float64{
.001, .003, .006, .010, .018, .024, .032, .042, .056, .075, .100, .178, .316, .562, 1, 5,
},
}),
))
}
srvMetrics := grpcprom.NewServerMetrics(opts...)
Expand Down

0 comments on commit 51edc2d

Please sign in to comment.