Commit b1fe53a3 authored by Vitali Tatarintev's avatar Vitali Tatarintev Committed by Michael Kozono

Add usage ping metric to count alert services

parent fb72ef07
---
title: Add a usage ping metric for number of activated Alert Services
merge_request: 19765
author:
type: added
......@@ -137,7 +137,8 @@ module EE
projects_reporting_ci_cd_back_to_github: count(::GithubService.without_defaults.active),
projects_with_packages: count(::Packages::Package.select('distinct project_id')),
projects_with_prometheus_alerts: count(PrometheusAlert.distinct_projects),
projects_with_tracing_enabled: count(ProjectTracingSetting)
projects_with_tracing_enabled: count(ProjectTracingSetting),
projects_with_alerts_service_enabled: count(AlertsService.active)
},
service_desk_counts,
security_products_usage,
......
......@@ -24,6 +24,9 @@ describe Gitlab::UsageData do
create(:prometheus_alert, project: projects[0])
create(:prometheus_alert, project: projects[1])
create(:alerts_service, project: projects[0])
create(:alerts_service, :inactive, project: projects[1])
create(:package, project: projects[0])
create(:package, project: projects[0])
create(:package, project: projects[1])
......@@ -83,6 +86,7 @@ describe Gitlab::UsageData do
projects_with_packages
projects_with_prometheus_alerts
projects_with_tracing_enabled
projects_with_alerts_service_enabled
sast_jobs
design_management_designs_create
design_management_designs_update
......@@ -94,6 +98,7 @@ describe Gitlab::UsageData do
expect(count_data[:projects_with_prometheus_alerts]).to eq(2)
expect(count_data[:projects_with_packages]).to eq(2)
expect(count_data[:feature_flags]).to eq(1)
expect(count_data[:projects_with_alerts_service_enabled]).to eq(1)
end
it 'has integer value for epic relationship level' do
......
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