mirror of
https://github.com/grafana/grafana.git
synced 2024-12-27 09:21:35 -06:00
GRPC Service: Use native histogram when enabled (#88804)
* use native histogram when enabled * enable native histograms permanently for grpc service histogram
This commit is contained in:
parent
5fc580b401
commit
1059441ec6
@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net"
|
||||
"time"
|
||||
|
||||
"github.com/grafana/dskit/instrument"
|
||||
"github.com/grafana/dskit/middleware"
|
||||
@ -51,10 +52,13 @@ func ProvideService(cfg *setting.Cfg, features featuremgmt.FeatureToggles, authe
|
||||
// nothing unless the feature is actually enabled.
|
||||
if grpcRequestDuration == nil {
|
||||
grpcRequestDuration = prometheus.NewHistogramVec(prometheus.HistogramOpts{
|
||||
Namespace: "grafana",
|
||||
Name: "grpc_request_duration_seconds",
|
||||
Help: "Time (in seconds) spent serving HTTP requests.",
|
||||
Buckets: instrument.DefBuckets,
|
||||
Namespace: "grafana",
|
||||
Name: "grpc_request_duration_seconds",
|
||||
Help: "Time (in seconds) spent serving gRPC calls.",
|
||||
Buckets: instrument.DefBuckets,
|
||||
NativeHistogramBucketFactor: 1.1, // enable native histograms
|
||||
NativeHistogramMaxBucketNumber: 160,
|
||||
NativeHistogramMinResetDuration: time.Hour,
|
||||
}, []string{"method", "route", "status_code", "ws"})
|
||||
|
||||
if err := registerer.Register(grpcRequestDuration); err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user