adjust metrics buckets
This commit is contained in:
@@ -10,6 +10,8 @@ const (
|
|||||||
metricsSubSystem = "dashboards"
|
metricsSubSystem = "dashboards"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var defaultBuckets = []float64{.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10, 25}
|
||||||
|
|
||||||
type dashboardsMetrics struct {
|
type dashboardsMetrics struct {
|
||||||
sharedWithMeFetchDashboardsRequestsDuration *prometheus.HistogramVec
|
sharedWithMeFetchDashboardsRequestsDuration *prometheus.HistogramVec
|
||||||
searchRequestsDuration *prometheus.HistogramVec
|
searchRequestsDuration *prometheus.HistogramVec
|
||||||
@@ -21,7 +23,7 @@ func newDashboardsMetrics(r prometheus.Registerer) *dashboardsMetrics {
|
|||||||
prometheus.HistogramOpts{
|
prometheus.HistogramOpts{
|
||||||
Name: "sharedwithme_fetch_dashboards_duration_seconds",
|
Name: "sharedwithme_fetch_dashboards_duration_seconds",
|
||||||
Help: "Duration of fetching dashboards with permissions directly assigned to user",
|
Help: "Duration of fetching dashboards with permissions directly assigned to user",
|
||||||
Buckets: []float64{.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10, 25, 50, 100},
|
Buckets: defaultBuckets,
|
||||||
Namespace: metricsNamespace,
|
Namespace: metricsNamespace,
|
||||||
Subsystem: metricsSubSystem,
|
Subsystem: metricsSubSystem,
|
||||||
},
|
},
|
||||||
@@ -31,7 +33,7 @@ func newDashboardsMetrics(r prometheus.Registerer) *dashboardsMetrics {
|
|||||||
prometheus.HistogramOpts{
|
prometheus.HistogramOpts{
|
||||||
Name: "search_dashboards_duration_seconds",
|
Name: "search_dashboards_duration_seconds",
|
||||||
Help: "Duration of dashboards search (by authorization engine)",
|
Help: "Duration of dashboards search (by authorization engine)",
|
||||||
Buckets: []float64{.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10, 25, 50, 100},
|
Buckets: defaultBuckets,
|
||||||
Namespace: metricsNamespace,
|
Namespace: metricsNamespace,
|
||||||
Subsystem: metricsSubSystem,
|
Subsystem: metricsSubSystem,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -47,8 +47,8 @@ func (dr *DashboardServiceImpl) findDashboardsZanzanaCompare(ctx context.Context
|
|||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
timer := prometheus.NewTimer(dr.metrics.searchRequestsDuration.WithLabelValues("zanzana"))
|
timer := prometheus.NewTimer(dr.metrics.searchRequestsDuration.WithLabelValues("zanzana"))
|
||||||
start := time.Now()
|
|
||||||
defer timer.ObserveDuration()
|
defer timer.ObserveDuration()
|
||||||
|
start := time.Now()
|
||||||
|
|
||||||
queryZanzana := *query
|
queryZanzana := *query
|
||||||
res, err := dr.findDashboardsZanzana(ctx, &queryZanzana)
|
res, err := dr.findDashboardsZanzana(ctx, &queryZanzana)
|
||||||
@@ -57,8 +57,8 @@ func (dr *DashboardServiceImpl) findDashboardsZanzanaCompare(ctx context.Context
|
|||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
timer := prometheus.NewTimer(dr.metrics.searchRequestsDuration.WithLabelValues("grafana"))
|
timer := prometheus.NewTimer(dr.metrics.searchRequestsDuration.WithLabelValues("grafana"))
|
||||||
start := time.Now()
|
|
||||||
defer timer.ObserveDuration()
|
defer timer.ObserveDuration()
|
||||||
|
start := time.Now()
|
||||||
|
|
||||||
res, err := dr.FindDashboards(ctx, query)
|
res, err := dr.FindDashboards(ctx, query)
|
||||||
result <- searchResult{"grafana", res, err, time.Since(start)}
|
result <- searchResult{"grafana", res, err, time.Since(start)}
|
||||||
|
|||||||
Reference in New Issue
Block a user