Skip to content
代码片段 群组 项目
提交 5b8f231c 编辑于 作者: Rajendra Kadam's avatar Rajendra Kadam 提交者: Peter Leitzen
浏览文件

Remove MetricEndpointInserter usages

上级 a871547d
No related branches found
No related tags found
无相关合并请求
...@@ -10,7 +10,6 @@ class BaseService < ::BaseService ...@@ -10,7 +10,6 @@ class BaseService < ::BaseService
STAGES = ::Gitlab::Metrics::Dashboard::Stages STAGES = ::Gitlab::Metrics::Dashboard::Stages
SEQUENCE = [ SEQUENCE = [
STAGES::CommonMetricsInserter, STAGES::CommonMetricsInserter,
STAGES::MetricEndpointInserter,
STAGES::VariableEndpointInserter, STAGES::VariableEndpointInserter,
STAGES::PanelIdsInserter, STAGES::PanelIdsInserter,
STAGES::TrackPanelType, STAGES::TrackPanelType,
......
...@@ -12,7 +12,6 @@ class GitlabAlertEmbedService < ::Metrics::Dashboard::BaseEmbedService ...@@ -12,7 +12,6 @@ class GitlabAlertEmbedService < ::Metrics::Dashboard::BaseEmbedService
include Gitlab::Utils::StrongMemoize include Gitlab::Utils::StrongMemoize
SEQUENCE = [ SEQUENCE = [
STAGES::MetricEndpointInserter,
STAGES::PanelIdsInserter STAGES::PanelIdsInserter
].freeze ].freeze
......
...@@ -10,7 +10,6 @@ class PodDashboardService < ::Metrics::Dashboard::PredefinedDashboardService ...@@ -10,7 +10,6 @@ class PodDashboardService < ::Metrics::Dashboard::PredefinedDashboardService
DASHBOARD_VERSION = '3a91b32f91b2dd3d90275333c0ea3630b3f3f37c4296ede5b5eef59bf523d66b' DASHBOARD_VERSION = '3a91b32f91b2dd3d90275333c0ea3630b3f3f37c4296ede5b5eef59bf523d66b'
SEQUENCE = [ SEQUENCE = [
STAGES::MetricEndpointInserter,
STAGES::VariableEndpointInserter, STAGES::VariableEndpointInserter,
STAGES::PanelIdsInserter STAGES::PanelIdsInserter
].freeze ].freeze
......
...@@ -10,7 +10,6 @@ class PredefinedDashboardService < ::Metrics::Dashboard::BaseService ...@@ -10,7 +10,6 @@ class PredefinedDashboardService < ::Metrics::Dashboard::BaseService
DASHBOARD_NAME = nil DASHBOARD_NAME = nil
SEQUENCE = [ SEQUENCE = [
STAGES::MetricEndpointInserter,
STAGES::VariableEndpointInserter, STAGES::VariableEndpointInserter,
STAGES::PanelIdsInserter STAGES::PanelIdsInserter
].freeze ].freeze
......
...@@ -15,7 +15,6 @@ class SystemDashboardService < ::Metrics::Dashboard::PredefinedDashboardService ...@@ -15,7 +15,6 @@ class SystemDashboardService < ::Metrics::Dashboard::PredefinedDashboardService
STAGES::CommonMetricsInserter, STAGES::CommonMetricsInserter,
STAGES::CustomMetricsInserter, STAGES::CustomMetricsInserter,
STAGES::CustomMetricsDetailsInserter, STAGES::CustomMetricsDetailsInserter,
STAGES::MetricEndpointInserter,
STAGES::VariableEndpointInserter, STAGES::VariableEndpointInserter,
STAGES::PanelIdsInserter STAGES::PanelIdsInserter
].freeze ].freeze
......
...@@ -28,11 +28,6 @@ def get_raw_dashboard ...@@ -28,11 +28,6 @@ def get_raw_dashboard
invalid_embed_json!(e.message) invalid_embed_json!(e.message)
end end
override :sequence
def sequence
[STAGES::MetricEndpointInserter]
end
override :identifiers override :identifiers
def identifiers def identifiers
Digest::SHA256.hexdigest(params[:embed_json]) Digest::SHA256.hexdigest(params[:embed_json])
......
...@@ -31,13 +31,6 @@ ...@@ -31,13 +31,6 @@
it_behaves_like 'misconfigured dashboard service response', :unprocessable_entity it_behaves_like 'misconfigured dashboard service response', :unprocessable_entity
end end
context 'when the dashboard contains a metric without a query' do
let(:dashboard) { { 'panel_groups' => [{ 'panels' => [{ 'metrics' => [{ 'id' => 'mock' }] }] }] } }
let(:project) { project_with_dashboard(dashboard_path, dashboard.to_yaml) }
it_behaves_like 'misconfigured dashboard service response', :unprocessable_entity
end
context 'when the system dashboard is specified' do context 'when the system dashboard is specified' do
let(:dashboard_path) { system_dashboard_path } let(:dashboard_path) { system_dashboard_path }
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
Gitlab::Metrics::Dashboard::Stages::CommonMetricsInserter, Gitlab::Metrics::Dashboard::Stages::CommonMetricsInserter,
Gitlab::Metrics::Dashboard::Stages::CustomMetricsInserter, Gitlab::Metrics::Dashboard::Stages::CustomMetricsInserter,
Gitlab::Metrics::Dashboard::Stages::CustomMetricsDetailsInserter, Gitlab::Metrics::Dashboard::Stages::CustomMetricsDetailsInserter,
Gitlab::Metrics::Dashboard::Stages::MetricEndpointInserter,
Gitlab::Metrics::Dashboard::Stages::PanelIdsInserter, Gitlab::Metrics::Dashboard::Stages::PanelIdsInserter,
Gitlab::Metrics::Dashboard::Stages::UrlValidator Gitlab::Metrics::Dashboard::Stages::UrlValidator
] ]
...@@ -91,8 +90,7 @@ ...@@ -91,8 +90,7 @@
context 'when the dashboard should not include project metrics' do context 'when the dashboard should not include project metrics' do
let(:sequence) do let(:sequence) do
[ [
Gitlab::Metrics::Dashboard::Stages::CommonMetricsInserter, Gitlab::Metrics::Dashboard::Stages::CommonMetricsInserter
Gitlab::Metrics::Dashboard::Stages::MetricEndpointInserter
] ]
end end
...@@ -105,16 +103,6 @@ ...@@ -105,16 +103,6 @@
expect(metrics).to eq %w(metric_b metric_a2 metric_a1) expect(metrics).to eq %w(metric_b metric_a2 metric_a1)
end end
end end
context 'when sample_metrics are requested' do
let(:process_params) { [project, dashboard_yml, sequence, { environment: environment, sample_metrics: true }] }
it 'includes a sample metrics path for the prometheus endpoint with each metric' do
expect(all_metrics).to satisfy_all do |metric|
metric[:prometheus_endpoint_path] == sample_metrics_path(metric[:id])
end
end
end
end end
context 'when there are no alerts' do context 'when there are no alerts' do
...@@ -153,12 +141,6 @@ ...@@ -153,12 +141,6 @@
it_behaves_like 'errors with message', 'Each "panel" must define an array :metrics' it_behaves_like 'errors with message', 'Each "panel" must define an array :metrics'
end end
context 'when the dashboard contains a metric which is missing a query' do
let(:dashboard_yml) { { panel_groups: [{ panels: [{ metrics: [{}] }] }] } }
it_behaves_like 'errors with message', 'Each "metric" must define one of :query or :query_range'
end
end end
private private
...@@ -177,7 +159,6 @@ def get_metric_details(metric) ...@@ -177,7 +159,6 @@ def get_metric_details(metric)
unit: metric.unit, unit: metric.unit,
label: metric.legend, label: metric.legend,
metric_id: metric.id, metric_id: metric.id,
prometheus_endpoint_path: prometheus_path(metric.query),
edit_path: edit_metric_path(metric) edit_path: edit_metric_path(metric)
} }
end end
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册