Commit 42e38b19 authored by Marius Bobin's avatar Marius Bobin

Remove feature flag for fronend Prometheus metrics

Remove feature flag for fronend Prometheus metrics
parent 1cdb4ed1
......@@ -25,8 +25,6 @@ module Ci
end
def execute
return ServiceResponse.success(http_status: :accepted) unless enabled?
params
.fetch(:histograms, [])
.each(&method(:observe))
......@@ -48,10 +46,6 @@ module Ci
.fetch(name) { raise ActiveRecord::RecordNotFound }
.call
end
def enabled?
::Feature.enabled?(:ci_accept_frontend_prometheus_metrics, project, default_enabled: :yaml)
end
end
end
end
---
name: ci_accept_frontend_prometheus_metrics
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/52820
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/300770
milestone: '13.9'
type: development
group: group::pipeline authoring
default_enabled: false
......@@ -24,20 +24,6 @@ RSpec.describe 'Projects::Ci::PrometheusMetrics::HistogramsController' do
expect(response).to have_gitlab_http_status(:not_found)
end
end
context 'with the feature flag disabled' do
before do
stub_feature_flags(ci_accept_frontend_prometheus_metrics: false)
end
it 'returns 202 Accepted' do
post histograms_route(histograms: [
{ name: :pipeline_graph_link_calculation_duration_seconds, value: 1 }
])
expect(response).to have_gitlab_http_status(:accepted)
end
end
end
def histograms_route(params = {})
......
......@@ -55,32 +55,6 @@ RSpec.describe Ci::PrometheusMetrics::ObserveHistogramsService do
end
end
context 'with feature flag disabled' do
before do
stub_feature_flags(ci_accept_frontend_prometheus_metrics: false)
end
let(:params) do
{
histograms: [
{ name: 'pipeline_graph_link_calculation_duration_seconds', value: '4' }
]
}
end
it 'does not register the metrics' do
execute
expect(histogram_data).to be_nil
end
it 'returns an empty body and status code' do
is_expected.to be_success
expect(subject.http_status).to eq(:accepted)
expect(subject.payload).to eq({})
end
end
def histogram_data(name = :pipeline_graph_link_calculation_duration_seconds)
Gitlab::Metrics.registry.get(name)&.get({})
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment