Replace project Monitor sidebar Tracing/Metrics/Logs with observability controller links
## Summary Behind a new feature flag `project_observability_menu_items` (scoped to `project`), replace three EE menu items in the project Monitor sidebar to point to the new `Projects::ObservabilityController` routes instead of the legacy tracing/metrics/logs controllers. | Current Item | Current Route | New Item | New Route | New `item_id` | |---|---|---|---|---| | Tracing | `project_tracing_index_path` | Traces | `namespace_project_observability_path(ns, project, 'traces-explorer')` | `:traces_explorer` | | Metrics | `project_metrics_path` | Metrics | `namespace_project_observability_sub_path_path(ns, project, 'metrics-explorer/summary')` | `:metrics_explorer` | | Logs | `project_logs_path` | Logs | `namespace_project_observability_sub_path_path(ns, project, 'logs/logs-explorer')` | `:logs_explorer` | When the flag is **off** (default), the existing items render unchanged. When **on**, the new items render instead. ## Files to change ### 1. Feature flag definition Create `config/feature_flags/wip/project_observability_menu_items.yml`: - Name: `project_observability_menu_items` - Type: `wip` (or `gitlab_com_derisk`) - Default: `false` ### 2. Super sidebar placeholder: `lib/sidebars/projects/super_sidebar_menus/monitor_menu.rb` Add three new placeholder `NilMenuItem` entries for the new item IDs: - `:traces_explorer` - `:metrics_explorer` - `:logs_explorer` ### 3. EE Monitor menu: `ee/lib/ee/sidebars/projects/menus/monitor_menu.rb` In `tracing_menu_item`, `metrics_menu_item`, and `logs_menu_item`: - Check `Feature.enabled?(:project_observability_menu_items, context.project)` - When **enabled**: return the new menu item with updated title, route, and `item_id`, using `super_sidebar_parent: ::Sidebars::Projects::SuperSidebarMenus::MonitorMenu` - When **disabled**: return the existing item (current behavior) - **Permission check**: Change from `can?(current_user, :read_observability, project)` to `Ability.allowed?(current_user, :read_observability_portal, project.group)` when the flag is enabled ### 4. EE Monitor menu spec: `ee/spec/lib/ee/sidebars/projects/menus/monitor_menu_spec.rb` Add test contexts for each of the three items when `project_observability_menu_items` is enabled: - Verify new title, route, and `item_id` - Verify permission check uses group-level `read_observability_portal` - Verify the old items are not rendered when flag is on - Verify the new items are not rendered when flag is off (existing tests cover this) ## Dependencies - !231526 in `gitlab-org/gitlab` (shared iframe partial extraction) - !231550 in `gitlab-org/gitlab` (project observability controller and views) ## Architecture notes - The new `item_id` values (`:traces_explorer`, `:metrics_explorer`, `:logs_explorer`) differ from the old ones (`:tracing`, `:metrics`, `:logs`) to avoid conflicts with the super sidebar placeholder registration. Both old and new placeholders will exist; only one set renders based on the feature flag. - The permission model changes from project-scoped `:read_observability` (which requires `observability_features` FF + `:observability` license on the project) to group-scoped `:read_observability_portal` (Developer+ role on the group, matching the controller's authorization).
issue