Usagestats: Add stat group for alert rule groups (#78825)

* Add rule group support to usagestats service

* Quote column name
This commit is contained in:
Alexander Weaver
2023-11-29 14:37:36 -06:00
committed by GitHub
parent a50be7ea0a
commit 8a56a94781
4 changed files with 16 additions and 0 deletions
+10
View File
@@ -185,6 +185,9 @@ var (
// StatsTotalAlertRules is a metric of total number of alert rules stored in Grafana.
StatsTotalAlertRules prometheus.Gauge
// StatsTotalRuleGroups is a metric of total number of alert rule groups stored in Grafana.
StatsTotalRuleGroups prometheus.Gauge
// StatsTotalDashboardVersions is a metric of total number of dashboard versions stored in Grafana.
StatsTotalDashboardVersions prometheus.Gauge
@@ -554,6 +557,12 @@ func init() {
Namespace: ExporterName,
})
StatsTotalRuleGroups = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "stat_totals_rule_groups",
Help: "total amount of alert rule groups in the database",
Namespace: ExporterName,
})
MAccessPermissionsSummary = prometheus.NewHistogram(prometheus.HistogramOpts{
Name: "access_permissions_duration",
Help: "Histogram for the runtime of permissions check function.",
@@ -708,6 +717,7 @@ func initMetricVars() {
StatsTotalDashboardVersions,
StatsTotalAnnotations,
StatsTotalAlertRules,
StatsTotalRuleGroups,
MAccessEvaluationCount,
StatsTotalLibraryPanels,
StatsTotalLibraryVariables,