mirror of https://github.com/grafana/grafana.git
31 lines
855 B
Go
31 lines
855 B
Go
|
|
package folderimpl
|
||
|
|
|
||
|
|
import (
|
||
|
|
"github.com/prometheus/client_golang/prometheus"
|
||
|
|
"github.com/prometheus/client_golang/prometheus/promauto"
|
||
|
|
)
|
||
|
|
|
||
|
|
const (
|
||
|
|
metricsNamespace = "grafana"
|
||
|
|
metricsSubSystem = "folders"
|
||
|
|
)
|
||
|
|
|
||
|
|
type foldersMetrics struct {
|
||
|
|
sharedWithMeFetchFoldersRequestsDuration *prometheus.HistogramVec
|
||
|
|
}
|
||
|
|
|
||
|
|
func newFoldersMetrics(r prometheus.Registerer) *foldersMetrics {
|
||
|
|
return &foldersMetrics{
|
||
|
|
sharedWithMeFetchFoldersRequestsDuration: promauto.With(r).NewHistogramVec(
|
||
|
|
prometheus.HistogramOpts{
|
||
|
|
Name: "sharedwithme_fetch_folders_duration_seconds",
|
||
|
|
Help: "Duration of fetching folders with permissions directly assigned to user",
|
||
|
|
Buckets: []float64{.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10, 25, 50, 100},
|
||
|
|
Namespace: metricsNamespace,
|
||
|
|
Subsystem: metricsSubSystem,
|
||
|
|
},
|
||
|
|
[]string{"status"},
|
||
|
|
),
|
||
|
|
}
|
||
|
|
}
|