Commit 26f09226 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch '10891-usage-ping-for-incident-management' into 'master'

Resolve "Usage ping for Incident Management"

See merge request gitlab-org/gitlab-ee!14013
parents bbb52fbb 7e48ea6f
......@@ -2,7 +2,9 @@
class Admin::ApplicationSettingsController < Admin::ApplicationController
include InternalRedirect
before_action :set_application_setting
before_action :whitelist_query_limiting, only: [:usage_data]
def show
end
......@@ -102,6 +104,10 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
@application_setting = Gitlab::CurrentSettings.current_application_settings
end
def whitelist_query_limiting
Gitlab::QueryLimiting.whitelist('https://gitlab.com/gitlab-org/gitlab-ce/issues/63107')
end
def application_setting_params
params[:application_setting] ||= {}
......
---
title: 'Usage ping: Track amount of incident issues'
merge_request: 14013
author:
type: added
......@@ -133,7 +133,8 @@ module EE
projects_with_tracing_enabled: count(ProjectTracingSetting),
projects_enforcing_code_owner_approval: count(::Project.without_deleted.non_archived.requiring_code_owner_approval),
operations_dashboard: operations_dashboard_usage,
dependency_list_usages_total: ::Gitlab::UsageCounters::DependencyList.usage_totals[:total]
dependency_list_usages_total: ::Gitlab::UsageCounters::DependencyList.usage_totals[:total],
incident_issues: count(::Issue.authored(::User.alert_bot))
}).merge(service_desk_counts).merge(security_products_usage)
# MySql does not support recursive queries so we can't retrieve epics relationship depth
......
......@@ -34,6 +34,8 @@ describe Gitlab::UsageData do
# for group_view testing
create(:user) # user with group_view = NULL (should be counted as having default value 'details')
create(:user, group_view: :details)
create(:issue, project: projects[0], author: User.alert_bot)
end
subject { described_class.data }
......@@ -83,11 +85,13 @@ describe Gitlab::UsageData do
feature_flags
operations_dashboard
dependency_list_usages_total
incident_issues
))
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[:incident_issues]).to eq(1)
end
it 'gathers deepest epic relationship level', :postgresql 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