Commit 51ca20d9 authored by alinamihaila's avatar alinamihaila

Migrate collected_data_categories metric

parent a3bf2c99
...@@ -13,6 +13,7 @@ introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/65336 ...@@ -13,6 +13,7 @@ introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/65336
time_frame: none time_frame: none
data_source: system data_source: system
data_category: Standard data_category: Standard
instrumentation_class: CollectedDataCategoriesMetric
distribution: distribution:
- ce - ce
- ee - ee
......
...@@ -5,6 +5,5 @@ remove_date: '2021-10-09' ...@@ -5,6 +5,5 @@ remove_date: '2021-10-09'
This file was moved to [another location](../service_ping/metrics_instrumentation.md). This file was moved to [another location](../service_ping/metrics_instrumentation.md).
<<<<<<< HEAD
<!-- This redirect file can be deleted after <2021-10-09>. --> <!-- This redirect file can be deleted after <2021-10-09>. -->
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page --> <!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page -->
...@@ -5,7 +5,7 @@ module Gitlab ...@@ -5,7 +5,7 @@ module Gitlab
module Metrics module Metrics
module Instrumentations module Instrumentations
class CollectedDataCategoriesMetric < GenericMetric class CollectedDataCategoriesMetric < GenericMetric
def value value do
::ServicePing::PermitDataCategoriesService.new.execute ::ServicePing::PermitDataCategoriesService.new.execute
end end
end end
......
...@@ -257,7 +257,7 @@ module Gitlab ...@@ -257,7 +257,7 @@ module Gitlab
ldap_encrypted_secrets_enabled: alt_usage_data(fallback: nil) { Gitlab::Auth::Ldap::Config.encrypted_secrets.active? }, ldap_encrypted_secrets_enabled: alt_usage_data(fallback: nil) { Gitlab::Auth::Ldap::Config.encrypted_secrets.active? },
operating_system: alt_usage_data(fallback: nil) { operating_system }, operating_system: alt_usage_data(fallback: nil) { operating_system },
gitaly_apdex: alt_usage_data { gitaly_apdex }, gitaly_apdex: alt_usage_data { gitaly_apdex },
collected_data_categories: alt_usage_data(fallback: []) { Gitlab::Usage::Metrics::Instrumentations::CollectedDataCategoriesMetric.new(time_frame: 'none').value } collected_data_categories: add_metric(Gitlab::Usage::Metrics::Instrumentations::CollectedDataCategoriesMetric.new(time_frame: 'none'))
} }
} }
end end
......
...@@ -42,6 +42,10 @@ RSpec.describe Gitlab::UsageDataMetrics do ...@@ -42,6 +42,10 @@ RSpec.describe Gitlab::UsageDataMetrics do
it 'includes usage_activity_by_stage_monthly keys' do it 'includes usage_activity_by_stage_monthly keys' do
expect(subject[:usage_activity_by_stage_monthly][:plan]).to include(:issues) expect(subject[:usage_activity_by_stage_monthly][:plan]).to include(:issues)
end end
it 'includes settings keys' do
expect(subject[:settings]).to include(:collected_data_categories)
end
end end
end 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