|
|
|
@ -154,6 +154,7 @@ func (s *Service) collectSystemStats(ctx context.Context) (map[string]interface{ |
|
|
|
|
m["stats.api_keys.count"] = statsQuery.Result.APIKeys |
|
|
|
|
m["stats.data_keys.count"] = statsQuery.Result.DataKeys |
|
|
|
|
m["stats.active_data_keys.count"] = statsQuery.Result.ActiveDataKeys |
|
|
|
|
m["stats.public_dashboards.count"] = statsQuery.Result.PublicDashboards |
|
|
|
|
|
|
|
|
|
ossEditionCount := 1 |
|
|
|
|
enterpriseEditionCount := 0 |
|
|
|
@ -344,6 +345,8 @@ func (s *Service) updateTotalStats(ctx context.Context) bool { |
|
|
|
|
inactiveDataKeys := statsQuery.Result.DataKeys - statsQuery.Result.ActiveDataKeys |
|
|
|
|
metrics.StatsTotalDataKeys.With(prometheus.Labels{"active": "false"}).Set(float64(inactiveDataKeys)) |
|
|
|
|
|
|
|
|
|
metrics.MStatTotalPublicDashboards.Set(float64(statsQuery.Result.PublicDashboards)) |
|
|
|
|
|
|
|
|
|
dsStats := models.GetDataSourceStatsQuery{} |
|
|
|
|
if err := s.sqlstore.GetDataSourceStats(ctx, &dsStats); err != nil { |
|
|
|
|
s.log.Error("Failed to get datasource stats", "error", err) |
|
|
|
|