Fix method to service in metric label for FolderID (#81283)

This commit is contained in:
idafurjes 2024-01-25 17:26:24 +01:00 committed by GitHub
parent dc9e590b7b
commit fb2b9f33d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -254,7 +254,7 @@ func init() {
httpStatusCodes := []string{"200", "404", "500", "unknown"} httpStatusCodes := []string{"200", "404", "500", "unknown"}
objectiveMap := map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001} objectiveMap := map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001}
apiFolderIDMethods := []string{GetAlerts, GetDashboard, RestoreDashboardVersion, GetFolderByID, GetFolderDescendantCounts, SearchFolders, GetFolderPermissionList, UpdateFolderPermissions, GetFolderACL, Search, GetDashboardACL, NewToFolderDTO, GetFolders} apiFolderIDMethods := []string{GetAlerts, GetDashboard, RestoreDashboardVersion, GetFolderByID, GetFolderDescendantCounts, SearchFolders, GetFolderPermissionList, UpdateFolderPermissions, GetFolderACL, Search, GetDashboardACL, NewToFolderDTO, GetFolders}
serviceFolderIDMethods := []string{Folder, Dashboard, LibraryElements, LibraryPanels, NGAlerts, Provisioning, PublicDashboards, AccessControl, Guardian, Search, DashboardImport} folderIDServices := []string{Folder, Dashboard, LibraryElements, LibraryPanels, NGAlerts, Provisioning, PublicDashboards, AccessControl, Guardian, Search, DashboardImport}
MInstanceStart = prometheus.NewCounter(prometheus.CounterOpts{ MInstanceStart = prometheus.NewCounter(prometheus.CounterOpts{
Name: "instance_start_total", Name: "instance_start_total",
@ -502,7 +502,7 @@ func init() {
Name: "folder_id_service_count", Name: "folder_id_service_count",
Help: "counter for folder id usage in service package", Help: "counter for folder id usage in service package",
Namespace: ExporterName, Namespace: ExporterName,
}, []string{"method"}, map[string][]string{"method": serviceFolderIDMethods}) }, []string{"service"}, map[string][]string{"service": folderIDServices})
MStatTotalDashboards = prometheus.NewGauge(prometheus.GaugeOpts{ MStatTotalDashboards = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "stat_totals_dashboard", Name: "stat_totals_dashboard",