Skip to content
Snippets Groups Projects
Commit ba93d4f4 authored by Mikołaj Wawrzyniak's avatar Mikołaj Wawrzyniak :one: Committed by Doug Stull
Browse files

Remove measure_service_ping_metric_collection ff

measure_service_ping_metric_collection feature was defualt enabled in
15.0, no issues were reported. It is time to remove feature flag and
release feature.

Changelog: other
parent d2c11b9b
No related branches found
No related tags found
1 merge request!92227Remove measure_service_ping_metric_collection ff
......@@ -52,8 +52,6 @@ def execute
ServicePing::DevopsReport.new(response).execute
end
return unless Feature.enabled?(:measure_service_ping_metric_collection)
submit_payload({ metadata: { metrics: metrics_collection_time(usage_data) } }, path: METADATA_PATH)
end
......
---
name: measure_service_ping_metric_collection
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/82607
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/358128
milestone: '15.0'
type: development
group: group::product intelligence
default_enabled: true
......@@ -113,11 +113,8 @@ sequenceDiagram
1. Finally, the timing metadata information that is used for diagnostic purposes is submitted to the Versions application. It consists of a list of metric identifiers and the time it took to calculate the metrics:
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/37911) in GitLab 15.0 [with a flag(../../user/feature_flags.md), enabled by default.
FLAG:
On self-managed GitLab, by default this feature is available. To hide the feature, ask an administrator to [disable the feature flag](../../administration/feature_flags.md) named `measure_service_ping_metric_collection`.
On GitLab.com, this feature is available.
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/37911) in GitLab 15.0 [with a flag(../../user/feature_flags.md), enabled by default.
> - [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/295289) in GitLab 15.2. [Feature flag `measure_service_ping_metric_collection`](https://gitlab.com/gitlab-org/gitlab/-/issues/358128) removed.
```ruby
{"metadata"=>
......@@ -161,25 +158,6 @@ We also collect metrics specific to [Geo](../../administration/geo/index.md) sec
]
```
### Enable or disable service ping metadata reporting
Service Ping timing metadata reporting is under development but ready for production use.
It is deployed behind a feature flag that is **enabled by default**.
[GitLab administrators with access to the GitLab Rails console](../../administration/feature_flags.md)
can opt to disable it.
To enable it:
```ruby
Feature.enable(:measure_service_ping_metric_collection)
```
To disable it:
```ruby
Feature.disable(:measure_service_ping_metric_collection)
```
## Implementing Service Ping
See the [implement Service Ping](implement.md) guide.
......
......@@ -651,8 +651,6 @@ def action_monthly_active_users(time_period)
end
def with_duration
return yield unless Feature.enabled?(:measure_service_ping_metric_collection)
result = nil
duration = Benchmark.realtime do
result = yield
......
......@@ -1365,29 +1365,11 @@ def for_defined_days_back(days: [31, 3])
end
describe ".with_duration" do
context 'with feature flag measure_service_ping_metric_collection turned off' do
before do
stub_feature_flags(measure_service_ping_metric_collection: false)
end
it 'does NOT record duration and return block response' do
expect(::Gitlab::Usage::ServicePing::LegacyMetricTimingDecorator).not_to receive(:new)
expect(described_class.with_duration { 1 + 1 }).to be 2
end
end
it 'records duration' do
expect(::Gitlab::Usage::ServicePing::LegacyMetricTimingDecorator)
.to receive(:new).with(2, kind_of(Float))
context 'with feature flag measure_service_ping_metric_collection turned off' do
before do
stub_feature_flags(measure_service_ping_metric_collection: true)
end
it 'records duration' do
expect(::Gitlab::Usage::ServicePing::LegacyMetricTimingDecorator)
.to receive(:new).with(2, kind_of(Float))
described_class.with_duration { 1 + 1 }
end
described_class.with_duration { 1 + 1 }
end
end
......
......@@ -377,62 +377,41 @@
stub_database_flavor_check
stub_application_setting(usage_ping_enabled: true)
stub_response(body: with_conv_index_params)
allow_next_instance_of(ServicePing::BuildPayload) do |service|
allow(service).to receive(:execute).and_return(payload)
end
end
context 'with feature flag measure_service_ping_metric_collection turned on' do
let(:metric_double) { instance_double(Gitlab::Usage::ServicePing::LegacyMetricTimingDecorator, duration: 123) }
let(:payload) do
{
metric_a: metric_double,
metric_group: {
metric_b: metric_double
},
metric_without_timing: "value",
recorded_at: Time.current
}
end
let(:metric_double) { instance_double(Gitlab::Usage::ServicePing::LegacyMetricTimingDecorator, duration: 123) }
let(:payload) do
{
metric_a: metric_double,
metric_group: {
metric_b: metric_double
},
metric_without_timing: "value",
recorded_at: Time.current
}
end
let(:metadata_payload) do
{
metadata: {
metrics: [
{ name: 'metric_a', time_elapsed: 123 },
{ name: 'metric_group.metric_b', time_elapsed: 123 }
]
}
let(:metadata_payload) do
{
metadata: {
metrics: [
{ name: 'metric_a', time_elapsed: 123 },
{ name: 'metric_group.metric_b', time_elapsed: 123 }
]
}
end
before do
stub_feature_flags(measure_service_ping_metric_collection: true)
allow_next_instance_of(ServicePing::BuildPayload) do |service|
allow(service).to receive(:execute).and_return(payload)
end
end
it 'submits metadata' do
response = stub_full_request(service_ping_metadata_url, method: :post)
.with(body: metadata_payload)
subject.execute
expect(response).to have_been_requested
end
}
end
context 'with feature flag measure_service_ping_metric_collection turned off' do
before do
stub_feature_flags(measure_service_ping_metric_collection: false)
end
it 'does NOT submit metadata' do
response = stub_full_request(service_ping_metadata_url, method: :post)
it 'submits metadata' do
response = stub_full_request(service_ping_metadata_url, method: :post)
.with(body: metadata_payload)
subject.execute
subject.execute
expect(response).not_to have_been_requested
end
expect(response).to have_been_requested
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment