From 48552a578a3ef03dd1fc523f9f1ab648230b9549 Mon Sep 17 00:00:00 2001 From: Adam Bannach <113929542+abannachGrafana@users.noreply.github.com> Date: Wed, 3 Jul 2024 11:59:47 -0500 Subject: [PATCH] feat: add adaptive logs under cost management->logs nav (#89875) Co-authored-by: Xiyu Chen --- pkg/services/navtree/models.go | 6 ++++++ pkg/services/navtree/navtreeimpl/applinks.go | 1 + 2 files changed, 7 insertions(+) diff --git a/pkg/services/navtree/models.go b/pkg/services/navtree/models.go index b3c22e7fdb5..59bd2fff3f4 100644 --- a/pkg/services/navtree/models.go +++ b/pkg/services/navtree/models.go @@ -140,6 +140,7 @@ func (root *NavTreeRoot) ApplyCostManagementIA() { orgAdminNode := root.FindById(NavIDCfg) var costManagementApp *NavLink var adaptiveMetricsApp *NavLink + var adaptiveLogsApp *NavLink var attributionsApp *NavLink var logVolumeExplorerApp *NavLink @@ -151,6 +152,8 @@ func (root *NavTreeRoot) ApplyCostManagementIA() { costManagementApp = element case "plugin-page-grafana-adaptive-metrics-app": adaptiveMetricsApp = element + case "plugin-page-grafana-adaptivelogs-app": + adaptiveLogsApp = element case "plugin-page-grafana-attributions-app": attributionsApp = element case "plugin-page-grafana-logvolumeexplorer-app": @@ -173,6 +176,9 @@ func (root *NavTreeRoot) ApplyCostManagementIA() { costManagementLogsNode := FindByURL(costManagementApp.Children, "/a/grafana-costmanagementui-app/logs") if costManagementLogsNode != nil { + if adaptiveLogsApp != nil { + costManagementLogsNode.Children = append(costManagementLogsNode.Children, adaptiveLogsApp) + } if logVolumeExplorerApp != nil { costManagementLogsNode.Children = append(costManagementLogsNode.Children, logVolumeExplorerApp) } diff --git a/pkg/services/navtree/navtreeimpl/applinks.go b/pkg/services/navtree/navtreeimpl/applinks.go index 8d146d61ef5..393af522b1c 100644 --- a/pkg/services/navtree/navtreeimpl/applinks.go +++ b/pkg/services/navtree/navtreeimpl/applinks.go @@ -298,6 +298,7 @@ func (s *ServiceImpl) readNavigationSettings() { "grafana-cloud-link-app": {SectionID: navtree.NavIDCfgPlugins, SortWeight: 3}, "grafana-costmanagementui-app": {SectionID: navtree.NavIDCfg, Text: "Cost management"}, "grafana-adaptive-metrics-app": {SectionID: navtree.NavIDCfg, Text: "Adaptive Metrics"}, + "grafana-adaptivelogs-app": {SectionID: navtree.NavIDCfg, Text: "Adaptive Logs"}, "grafana-attributions-app": {SectionID: navtree.NavIDCfg, Text: "Attributions"}, "grafana-logvolumeexplorer-app": {SectionID: navtree.NavIDCfg, Text: "Log Volume Explorer"}, "grafana-easystart-app": {SectionID: navtree.NavIDRoot, SortWeight: navtree.WeightApps + 1, Text: "Connections", Icon: "adjust-circle"},