mirror of
https://github.com/grafana/grafana.git
synced 2025-08-01 07:01:49 +08:00
Prometheus Metrics: Add missing stat_total_teams metric (#65133)
* Prometheus Metrics: Add missing stat_total_teams metric
This commit is contained in:
@ -143,6 +143,9 @@ var (
|
|||||||
// MStatTotalUsers is a metric total amount of users
|
// MStatTotalUsers is a metric total amount of users
|
||||||
MStatTotalUsers prometheus.Gauge
|
MStatTotalUsers prometheus.Gauge
|
||||||
|
|
||||||
|
// MStatTotalTeams is a metric total amount of teams
|
||||||
|
MStatTotalTeams prometheus.Gauge
|
||||||
|
|
||||||
// MStatActiveUsers is a metric number of active users
|
// MStatActiveUsers is a metric number of active users
|
||||||
MStatActiveUsers prometheus.Gauge
|
MStatActiveUsers prometheus.Gauge
|
||||||
|
|
||||||
@ -445,6 +448,12 @@ func init() {
|
|||||||
Namespace: ExporterName,
|
Namespace: ExporterName,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
MStatTotalTeams = prometheus.NewGauge(prometheus.GaugeOpts{
|
||||||
|
Name: "stat_total_teams",
|
||||||
|
Help: "total amount of teams",
|
||||||
|
Namespace: ExporterName,
|
||||||
|
})
|
||||||
|
|
||||||
MStatActiveUsers = prometheus.NewGauge(prometheus.GaugeOpts{
|
MStatActiveUsers = prometheus.NewGauge(prometheus.GaugeOpts{
|
||||||
Name: "stat_active_users",
|
Name: "stat_active_users",
|
||||||
Help: "number of active users",
|
Help: "number of active users",
|
||||||
@ -661,6 +670,7 @@ func initMetricVars() {
|
|||||||
MStatTotalDashboards,
|
MStatTotalDashboards,
|
||||||
MStatTotalFolders,
|
MStatTotalFolders,
|
||||||
MStatTotalUsers,
|
MStatTotalUsers,
|
||||||
|
MStatTotalTeams,
|
||||||
MStatActiveUsers,
|
MStatActiveUsers,
|
||||||
MStatTotalOrgs,
|
MStatTotalOrgs,
|
||||||
MStatTotalPlaylists,
|
MStatTotalPlaylists,
|
||||||
|
@ -312,6 +312,7 @@ func (s *Service) updateTotalStats(ctx context.Context) bool {
|
|||||||
metrics.MStatTotalDashboards.Set(float64(statsQuery.Result.Dashboards))
|
metrics.MStatTotalDashboards.Set(float64(statsQuery.Result.Dashboards))
|
||||||
metrics.MStatTotalFolders.Set(float64(statsQuery.Result.Folders))
|
metrics.MStatTotalFolders.Set(float64(statsQuery.Result.Folders))
|
||||||
metrics.MStatTotalUsers.Set(float64(statsQuery.Result.Users))
|
metrics.MStatTotalUsers.Set(float64(statsQuery.Result.Users))
|
||||||
|
metrics.MStatTotalTeams.Set(float64(statsQuery.Result.Teams))
|
||||||
metrics.MStatActiveUsers.Set(float64(statsQuery.Result.ActiveUsers))
|
metrics.MStatActiveUsers.Set(float64(statsQuery.Result.ActiveUsers))
|
||||||
metrics.MStatTotalPlaylists.Set(float64(statsQuery.Result.Playlists))
|
metrics.MStatTotalPlaylists.Set(float64(statsQuery.Result.Playlists))
|
||||||
metrics.MStatTotalOrgs.Set(float64(statsQuery.Result.Orgs))
|
metrics.MStatTotalOrgs.Set(float64(statsQuery.Result.Orgs))
|
||||||
|
Reference in New Issue
Block a user