The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/pkg/services/folder/folderimpl/metrics.go

41 lines
1.3 KiB

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
foldersGetChildrenRequestsDuration *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"},
),
foldersGetChildrenRequestsDuration: promauto.With(r).NewHistogramVec(
prometheus.HistogramOpts{
Name: "get_children_duration_seconds",
Help: "Duration of listing subfolders in specific folder",
Buckets: []float64{.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10, 25, 50, 100},
Namespace: metricsNamespace,
Subsystem: metricsSubSystem,
},
[]string{"parent"},
),
}
}