mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Usagestats: Add stat group for alert rule groups (#78825)
* Add rule group support to usagestats service * Quote column name
This commit is contained in:
@@ -26,6 +26,7 @@ type SystemStats struct {
|
||||
DashboardVersions int64
|
||||
Annotations int64
|
||||
AlertRules int64
|
||||
RuleGroups int64
|
||||
LibraryPanels int64
|
||||
LibraryVariables int64
|
||||
DashboardsViewersCanEdit int64
|
||||
|
||||
@@ -128,6 +128,9 @@ func (ss *sqlStatsService) GetSystemStats(ctx context.Context, query *stats.GetS
|
||||
sb.Write(`(SELECT COUNT(*) FROM ` + dialect.Quote("data_keys") + `WHERE active = true) AS active_data_keys,`)
|
||||
sb.Write(`(SELECT COUNT(*) FROM ` + dialect.Quote("dashboard_public") + `) AS public_dashboards,`)
|
||||
sb.Write(`(SELECT MIN(timestamp) FROM ` + dialect.Quote("migration_log") + `) AS database_created_time,`)
|
||||
if ss.IsUnifiedAlertingEnabled() {
|
||||
sb.Write(`(SELECT COUNT(DISTINCT (` + dialect.Quote("rule_group") + `)) FROM ` + dialect.Quote("alert_rule") + `) AS rule_groups,`)
|
||||
}
|
||||
|
||||
sb.Write(ss.roleCounterSQL(ctx))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user