grpc: client/server histogram bucket change (#7591)
Changes the default grpc client/server histogram buckets from the defaults to better track the long tail of slow requests. Removes `.005` and `.25` granularity in favor of adding the larger values of `45` and `90` to avoid changing the cardinality. ``` # Before, the default prometheus buckets []float64{.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10} # After []float64{.01, .025, .05, .1, .5, 1, 2.5, 5, 10, 45, 90} ``` Fixes https://github.com/letsencrypt/boulder/issues/6384
This commit is contained in:
parent
f2e46486f9
commit
07d6713736
|
@ -85,7 +85,9 @@ type clientMetrics struct {
|
||||||
func newClientMetrics(stats prometheus.Registerer) (clientMetrics, error) {
|
func newClientMetrics(stats prometheus.Registerer) (clientMetrics, error) {
|
||||||
// Create the grpc prometheus client metrics instance and register it
|
// Create the grpc prometheus client metrics instance and register it
|
||||||
grpcMetrics := grpc_prometheus.NewClientMetrics(
|
grpcMetrics := grpc_prometheus.NewClientMetrics(
|
||||||
grpc_prometheus.WithClientHandlingTimeHistogram(),
|
grpc_prometheus.WithClientHandlingTimeHistogram(
|
||||||
|
grpc_prometheus.WithHistogramBuckets([]float64{.01, .025, .05, .1, .5, 1, 2.5, 5, 10, 45, 90}),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
err := stats.Register(grpcMetrics)
|
err := stats.Register(grpcMetrics)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -292,7 +292,9 @@ type serverMetrics struct {
|
||||||
func newServerMetrics(stats prometheus.Registerer) (serverMetrics, error) {
|
func newServerMetrics(stats prometheus.Registerer) (serverMetrics, error) {
|
||||||
// Create the grpc prometheus server metrics instance and register it
|
// Create the grpc prometheus server metrics instance and register it
|
||||||
grpcMetrics := grpc_prometheus.NewServerMetrics(
|
grpcMetrics := grpc_prometheus.NewServerMetrics(
|
||||||
grpc_prometheus.WithServerHandlingTimeHistogram(),
|
grpc_prometheus.WithServerHandlingTimeHistogram(
|
||||||
|
grpc_prometheus.WithHistogramBuckets([]float64{.01, .025, .05, .1, .5, 1, 2.5, 5, 10, 45, 90}),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
err := stats.Register(grpcMetrics)
|
err := stats.Register(grpcMetrics)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue