Commit 86f6a43f authored by Nicolas Dular's avatar Nicolas Dular Committed by Alper Akgun

Add usage ping feature metric

parent 115b29aa
---
key_path: settings.service_ping_features_enabled
name: "service_ping_features_enabled"
description: Whether Service Ping features are enabled
product_section: growth
product_stage: growth
product_group: group::product intelligence
product_category: collection
value_type: boolean
status: active
milestone: "14.3"
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/70332
time_frame: none
data_source: database
instrumentation_class: ServicePingFeaturesMetric
data_category: optional
distribution:
- ce
- ee
tier:
- free
- premium
- ultimate
# frozen_string_literal: true
module Gitlab
module Usage
module Metrics
module Instrumentations
class ServicePingFeaturesMetric < GenericMetric
value do
Gitlab::CurrentSettings.usage_ping_features_enabled
end
end
end
end
end
end
......@@ -259,7 +259,8 @@ module Gitlab
smtp_encrypted_secrets_enabled: alt_usage_data(fallback: nil) { Gitlab::Email::SmtpConfig.encrypted_secrets.active? },
operating_system: alt_usage_data(fallback: nil) { operating_system },
gitaly_apdex: alt_usage_data { gitaly_apdex },
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')
}
}
end
......
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Gitlab::Usage::Metrics::Instrumentations::ServicePingFeaturesMetric do
using RSpec::Parameterized::TableSyntax
where(:usage_ping_features_enabled, :expected_value) do
true | true
false | false
end
with_them do
before do
stub_application_setting(usage_ping_features_enabled: usage_ping_features_enabled)
end
it_behaves_like 'a correct instrumented metric value', { time_frame: 'none' }
end
end
......@@ -1089,6 +1089,10 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
expect(subject[:settings][:collected_data_categories]).to eq(expected_value)
end
it 'gathers service_ping_features_enabled' do
expect(subject[:settings][:service_ping_features_enabled]).to eq(Gitlab::CurrentSettings.usage_ping_features_enabled)
end
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