Commit e67ba2d7 authored by Mikołaj Wawrzyniak's avatar Mikołaj Wawrzyniak

Merge branch '353415-add-usage-of-the-certificate_based_clusters-ff-to-service-ping' into 'master'

Add certificate_based_clusters FF to Service Ping

See merge request gitlab-org/gitlab!81311
parents 0b3e5c6c 33601c63
---
key_path: settings.certificate_based_clusters_ff
name: "certificate_based_clusters_ff"
description: "Certificate-based clusters feature flag"
product_section: ops
product_stage: configure
product_group: group::configure
product_category:
value_type: boolean
status: active
milestone: "14.9"
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/81311
time_frame: none
data_source: database
data_category: optional
instrumentation_class: CertBasedClustersFfMetric
performance_indicator_type: []
distribution:
- ce
- ee
tier:
- free
- premium
- ultimate
# frozen_string_literal: true
module Gitlab
module Usage
module Metrics
module Instrumentations
class CertBasedClustersFfMetric < GenericMetric
value do
Feature.enabled?(:certificate_based_clusters, default_enabled: :yaml, type: :ops)
end
end
end
end
end
end
...@@ -224,7 +224,8 @@ module Gitlab ...@@ -224,7 +224,8 @@ module Gitlab
collected_data_categories: add_metric('CollectedDataCategoriesMetric', time_frame: 'none'), collected_data_categories: add_metric('CollectedDataCategoriesMetric', time_frame: 'none'),
service_ping_features_enabled: add_metric('ServicePingFeaturesMetric', time_frame: 'none'), service_ping_features_enabled: add_metric('ServicePingFeaturesMetric', time_frame: 'none'),
snowplow_enabled: add_metric('SnowplowEnabledMetric', time_frame: 'none'), snowplow_enabled: add_metric('SnowplowEnabledMetric', time_frame: 'none'),
snowplow_configured_to_gitlab_collector: add_metric('SnowplowConfiguredToGitlabCollectorMetric', time_frame: 'none') snowplow_configured_to_gitlab_collector: add_metric('SnowplowConfiguredToGitlabCollectorMetric', time_frame: 'none'),
certificate_based_clusters_ff: add_metric('CertBasedClustersFfMetric')
} }
} }
end end
......
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Gitlab::Usage::Metrics::Instrumentations::CertBasedClustersFfMetric do
context 'with FF enabled' do
it_behaves_like 'a correct instrumented metric value', { time_frame: '7d', data_source: 'database' } do
let(:expected_value) { true }
end
end
context 'with FF disabled' do
before do
stub_feature_flags(certificate_based_clusters: false)
end
it_behaves_like 'a correct instrumented metric value', { time_frame: '7d', data_source: 'database' } do
let(:expected_value) { false }
end
end
end
...@@ -1100,6 +1100,20 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do ...@@ -1100,6 +1100,20 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
expect(subject[:settings][:user_cap_feature_enabled]).to eq(Gitlab::CurrentSettings.new_user_signups_cap) expect(subject[:settings][:user_cap_feature_enabled]).to eq(Gitlab::CurrentSettings.new_user_signups_cap)
end end
it 'reports status of the certificate_based_clusters feature flag as true' do
expect(subject[:settings][:certificate_based_clusters_ff]).to eq(true)
end
context 'with certificate_based_clusters disabled' do
before do
stub_feature_flags(certificate_based_clusters: false)
end
it 'reports status of the certificate_based_clusters feature flag as false' do
expect(subject[:settings][:certificate_based_clusters_ff]).to eq(false)
end
end
context 'snowplow stats' do context 'snowplow stats' do
before do before do
stub_feature_flags(usage_data_instrumentation: false) stub_feature_flags(usage_data_instrumentation: false)
......
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