|
|
|
|
@ -6,6 +6,7 @@ import ( |
|
|
|
|
"github.com/prometheus/client_golang/prometheus" |
|
|
|
|
|
|
|
|
|
"github.com/grafana/grafana/pkg/infra/metrics/metricutil" |
|
|
|
|
"github.com/grafana/grafana/pkg/services/accesscontrol" |
|
|
|
|
pubdash "github.com/grafana/grafana/pkg/services/publicdashboards/models" |
|
|
|
|
"github.com/grafana/grafana/pkg/setting" |
|
|
|
|
) |
|
|
|
|
@ -104,6 +105,9 @@ var ( |
|
|
|
|
// MAccessEvaluationCount is a metric gauge for total number of evaluation requests
|
|
|
|
|
MAccessEvaluationCount prometheus.Counter |
|
|
|
|
|
|
|
|
|
// MAccessPermissionsCacheUsage is a metric counter for cache usage
|
|
|
|
|
MAccessPermissionsCacheUsage *prometheus.CounterVec |
|
|
|
|
|
|
|
|
|
// MPublicDashboardRequestCount is a metric counter for public dashboards requests
|
|
|
|
|
MPublicDashboardRequestCount prometheus.Counter |
|
|
|
|
|
|
|
|
|
@ -590,6 +594,12 @@ func init() { |
|
|
|
|
Buckets: prometheus.ExponentialBuckets(0.001, 10, 6), |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
MAccessPermissionsCacheUsage = metricutil.NewCounterVecStartingAtZero(prometheus.CounterOpts{ |
|
|
|
|
Name: "access_permissions_cache_usage", |
|
|
|
|
Help: "access control permissions cache hit/miss", |
|
|
|
|
Namespace: ExporterName, |
|
|
|
|
}, []string{"status"}, map[string][]string{"status": accesscontrol.CacheUsageStatuses}) |
|
|
|
|
|
|
|
|
|
StatsTotalLibraryPanels = prometheus.NewGauge(prometheus.GaugeOpts{ |
|
|
|
|
Name: "stat_totals_library_panels", |
|
|
|
|
Help: "total amount of library panels in the database", |
|
|
|
|
@ -708,6 +718,8 @@ func initMetricVars(reg prometheus.Registerer) { |
|
|
|
|
MAccessPermissionsSummary, |
|
|
|
|
MAccessEvaluationsSummary, |
|
|
|
|
MAccessSearchPermissionsSummary, |
|
|
|
|
MAccessEvaluationCount, |
|
|
|
|
MAccessPermissionsCacheUsage, |
|
|
|
|
MAlertingActiveAlerts, |
|
|
|
|
MStatTotalDashboards, |
|
|
|
|
MStatTotalFolders, |
|
|
|
|
@ -728,7 +740,6 @@ func initMetricVars(reg prometheus.Registerer) { |
|
|
|
|
StatsTotalAnnotations, |
|
|
|
|
StatsTotalAlertRules, |
|
|
|
|
StatsTotalRuleGroups, |
|
|
|
|
MAccessEvaluationCount, |
|
|
|
|
StatsTotalLibraryPanels, |
|
|
|
|
StatsTotalLibraryVariables, |
|
|
|
|
StatsTotalDataKeys, |
|
|
|
|
|