Skip to content

Commit

Permalink
chore: use native histogram for metastore_request_duration_seconds (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
grobinson-grafana committed Jul 29, 2024
1 parent 5a87ccb commit a77457f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions pkg/ingester-rf1/metastore/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"fmt"

"github.com/grafana/dskit/grpcclient"
"github.com/grafana/dskit/instrument"
"github.com/grafana/dskit/middleware"
"github.com/grafana/dskit/services"
"github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc"
Expand All @@ -14,7 +13,6 @@ import (
"google.golang.org/grpc"

"github.com/grafana/loki/v3/pkg/ingester-rf1/metastore/metastorepb"
"github.com/grafana/loki/v3/pkg/util/constants"
)

type Config struct {
Expand Down Expand Up @@ -58,10 +56,10 @@ func (c *Client) Service() services.Service { return c.service }

func dial(cfg Config, r prometheus.Registerer) (*grpc.ClientConn, error) {
latency := prometheus.NewHistogramVec(prometheus.HistogramOpts{
Namespace: constants.Loki,
Name: "metastore_request_duration_seconds",
Help: "Time (in seconds) spent serving requests when using the metastore",
Buckets: instrument.DefBuckets,
Name: "loki_metastore_request_duration_seconds",
Help: "Time (in seconds) spent serving requests when using the metastore",
Buckets: prometheus.ExponentialBuckets(0.001, 4, 8),
NativeHistogramBucketFactor: 1.1,
}, []string{"operation", "status_code"})
if r != nil {
err := r.Register(latency)
Expand Down

0 comments on commit a77457f

Please sign in to comment.