Skip to content

Technical Breakdown for Monitor: Metrics Removal

This is the technical breakdown for Monitor: Metrics Deprecation (gitlab-org/gitlab#346541 - closed) & Remove Embed Grafana panels in Markdown (gitlab-org/gitlab#389477 - closed).

The breakdown below served as a very useful starting point, but is not 100% accurate to the plan. Refer to the issues in Monitor: Metrics Deprecation and Removal (gitlab-org&10107 - closed) directly for the latest plan.

Removal breakdown

List of features which should not be available

See designs section for screenshots of views that are to be removed

Dependencies, impact & blockers

Health metrics are supported for instance level clusters, so we'll want a global feature flag rather than one for individual actors.

Blockers

Note that ~/monitoring/components/embeds/embed_group.vue component is used in app/assets/javascripts/behaviors/markdown/render_metrics.js, but it is going to be removed as well.

Relevant files

backend

Relevant files

Entrypoints:

  • app/controllers/concerns/metrics_dashboard.rb
  • ee/spec/controllers/operations_controller_spec.rb
  • [TODO: Keep going with listing]

Deletions:

  • app/controllers/projects/metrics_dashboard_controller.rb
  • app/controllers/concerns/metrics_dashboard.rb
  • app/controllers/concerns/metrics/dashboard/prometheus_api_proxy.rb
  • app/services/metrics/dashboard/* (except grafana in scope of #202 (closed))
  • app/services/prometheus/*
  • app/services/metrics/*
  • app/models/metrics/*
  • app/models/blob_viewer/metrics_dashboard_yml.rb
  • app/models/prometheus_metric.rb
  • app/models/prometheus_alert.rb
  • app/models/prometheus_alert_event.rb
  • app/models/self_managed_prometheus_alert_event.rb
  • app/graphql/types/metrics/*
  • app/graphql/types/prometheus_alert_type.rb
  • app/presenters/prometheus_alert_presenter.rb
  • app/serializers/prometheus_alert_entity.rb
  • lib/gitlab/prometheus/* (except internal.rb in scope of #112 (closed))
  • lib/gitlab/database_importers/common_metrics/*
  • lib/gitlab/template/metrics_dashboard_template.rb
  • lib/gitlab/metrics/dashboard/*
  • lib/banzai/filter/inline_alert_metrics_filter.rb
  • lib/banzai/filter/inline_cluster_metrics_filter.rb
  • lib/banzai/filter/inline_metrics_filter.rb
  • config/prometheus/common_metrics.yml
  • lib/banzai/filter/inline_grafana_metrics_filter.rb

Feature/integration test deletions:

  • spec/frontend/fixtures/metrics_dashboard.rb
  • spec/features/markdown/metrics_spec.rb
  • spec/features/clusters/cluster_health_dashboard_spec.rb
  • spec/features/projects/environments/environment_metrics_spec.rb
  • ee/spec/features/markdown/metrics_spec.rb
  • ee/spec/features/projects/integrations/prometheus_custom_metrics_spec.rb
  • spec/support/helpers/metrics_dashboard_url_helpers.rb
  • spec/db/schema_spec.rb

Cleanups:

  • app/controllers/projects/environments_controller.rb
  • app/models/integrations/prometheus.rb [alert integration uses this as a backend, so we can't get rid of it entirely yet]
  • app/controllers/clusters/clusters_controller.rb
  • app/controllers/projects/environments_controller.rb
  • app/controllers/projects/prometheus/alerts_controller.rb
  • app/graphql/types/alert_management/alert_type.rb
  • app/presenters/alert_management/alert_presenter.rb
  • app/finders/template_finder.rb
  • app/helpers/projects_helper.rb
  • app/models/blob.rb
  • app/models/environment.rb [TODO: track through usages of alert/metrics references]
  • app/models/project.rb [TODO: track through usages of alert/metrics references]
  • lib/gitlab/alert_management/payload/base.rb
  • lib/gitlab/alert_management/payload/managed_prometheus.rb
  • lib/gitlab/alert_management/payload/prometheus.rb
  • lib/banzai/pipeline/gfm_pipeline.rb
  • lib/banzai/filter/inline_embeds_filter.rb (still required for observability embeds)
  • ee/lib/ee/banzai/pipeline/gfm_pipeline.rb
  • db/fixtures/development/99_common_metrics.rb
  • db/fixtures/production/999_common_metrics.rb
  • ee/app/models/gitlab_subscriptions/features.rb
  • ee/app/services/dashboard/operations/list_service.rb

Out of scope

  • app/models/clusters/applications/prometheus.rb
  • app/models/clusters/integrations/prometheus.rb
  • app/models/clusters/concerns/prometheus_client.rb
  • app/models/concerns/prometheus_adapter.rb
  • lib/gitlab/prometheus_client.rb

frontend

Relevant files
  • app/assets/javascripts/monitoring/*
  • app/views/projects/environments/metrics.html.haml
  • app/assets/stylesheets/page_bundles/prometheus.scss
  • spec/frontend/monitoring
  • lib/sidebars/projects/menus/monitor_menu.rb
  • app/assets/javascripts/operation_settings/*
  • spec/frontend/operation_settings
  • app/assets/javascripts/pages/projects/clusters/show/cluster_health.js
  • app/views/clusters/clusters/_health.html.haml
  • app/views/clusters/clusters/_health_tab.html.haml
  • app/assets/javascripts/pages/projects/clusters/show/index.js
  • app/assets/javascripts/vue_shared/alert_details/components/alert_metrics.vue
  • app/assets/javascripts/pages/projects/environments/metrics/*
  • app/assets/javascripts/pages/projects/metrics_dashboard/*
  • app/assets/javascripts/vue_shared/components/date_time_picker/*
  • app/assets/javascripts/grafana_integration
  • spec/frontend/grafana_integration

documentation

Issue breakdown & timeline

Phase 0 - Bonus deprecation notices (%15.10)

  • Add deprecation notices to relevant GraphQL fields backend

Phase 1 - Add feature flag (%15.10 - %16.0)

  1. Gate UI pages/navigation with feature flag disable_metrics frontend
  2. Set up 404s for all API endpoints with feature flag disable_metrics backend
  3. Update documentation to reference flag

Phase 2 - Code removal (%16.0)

  1. Enable feature flag to remove all features
  2. Update documentation to reflect new feature flag state

Frontend

  • remove Monitor > Metrics view and left navigation item
  • remove Settings > Monitor > Metrics
  • remove Settings > Integrations > Prometheus > Metrics
  • remove Health tab from Infrastructure > Cluster
  • remove Settings > General > Visibility, project features, permissions > Monitor > Metrics Dashboard
  • remove Settings > Monitor > Grafana authentication
  • remove date_time_picker.vue & date_time_picker_input.vue component used only in monitoring
  • remove metrics embeds rendering
    • remove alert_metrics.vue component. It's no longer used on Alert detail > Metrics and references ~/monitoring/components/embeds/metric_embed.vue and ~/monitoring/stores
    • this should be done after parsing is removed on the backend

Backend

  1. Set service ping metrics to -1
  2. Remove metrics embeds parsing
    • this should be done before frontend removes rendering so that we don't parse & replace links that the FE then ignores
    • QUESTION: Do we need to re-cache any GFM?
  3. Remove grafana client & dashboard logic
  4. Remove grafana integration settings
  5. Remove dashboard settings
  6. Remove metrics dashboard APIs (embeds, alerts, clusters)
  7. Remove metrics dashboard importers & fixtures
  8. Remove custom dashboard APIs & logic
  9. Remove all metrics dashboard services
  10. Remove handling of prometheus alert ids & cluster integrations from alert notification services
  11. Remove references to prometheus alerts from operations dashboard / around application
  12. Remove prometheus alert models
  13. [TODO: Keep going]
  14. Remove database tables

Documentation

Issue Notes Backend Frontend Milestone
Add feature flag for deleting Monitor Metrics
Delete health tab from cluster view
Delete alert_metrics component
Delete Metrics settings
Delete Metrics view
Delete Grafana integration settings

Definition of done

The following are recommended prior to starting removal:

  • Detailed breakdown issue was posted to #g_respond with request for feedback
  • All needed issues are created & linked to the appropriate epic
  • All open threads are resolved or determined non-blocking
Edited by Sarah Yasonik