Commit 530471b5 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch '300770-feature-flag-rollout-of-ci_accept_frontend_prometheus_metrics' into 'master'

Remove `ci_accept_frontend_prometheus_metrics` feature flag [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!60633
parents 5c287c00 86f6c06b
...@@ -25,8 +25,6 @@ module Ci ...@@ -25,8 +25,6 @@ module Ci
end end
def execute def execute
return ServiceResponse.success(http_status: :accepted) unless enabled?
params params
.fetch(:histograms, []) .fetch(:histograms, [])
.each(&method(:observe)) .each(&method(:observe))
...@@ -48,10 +46,6 @@ module Ci ...@@ -48,10 +46,6 @@ module Ci
.fetch(name) { raise ActiveRecord::RecordNotFound } .fetch(name) { raise ActiveRecord::RecordNotFound }
.call .call
end end
def enabled?
::Feature.enabled?(:ci_accept_frontend_prometheus_metrics, project, default_enabled: :yaml)
end
end end
end end
end end
---
title: Allow frontend to observe Prometheus metrics
merge_request: 60633
author:
type: added
---
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 ...@@ -24,20 +24,6 @@ RSpec.describe 'Projects::Ci::PrometheusMetrics::HistogramsController' do
expect(response).to have_gitlab_http_status(:not_found) expect(response).to have_gitlab_http_status(:not_found)
end end
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 end
def histograms_route(params = {}) def histograms_route(params = {})
......
...@@ -55,32 +55,6 @@ RSpec.describe Ci::PrometheusMetrics::ObserveHistogramsService do ...@@ -55,32 +55,6 @@ RSpec.describe Ci::PrometheusMetrics::ObserveHistogramsService do
end end
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) def histogram_data(name = :pipeline_graph_link_calculation_duration_seconds)
Gitlab::Metrics.registry.get(name)&.get({}) Gitlab::Metrics.registry.get(name)&.get({})
end 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