Use a finder for PrometheusMetric

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

  • Close this issue

Summary

We are currently using PrometheusMetric directly in quite a few places. We should use a finder instead. See comment https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/14356#note_189280706

Improvements

Risks

Involved components

  • all_groups = ::PrometheusMetric.common.group_by(&:group_title).map do |name, metrics|
  • CommonMetrics::PrometheusMetric.reset_column_information
  • CommonMetrics::PrometheusMetric.common.find_by(identifier: id) ||
  • CommonMetrics::PrometheusMetric.new(common: true, identifier: id)
  • common_metrics = ::PrometheusMetric.common

Optional: Intended side effects

Optional: Missing test coverage

Edited Sep 28, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading