Commit 59f50c57 authored by Ash McKenzie's avatar Ash McKenzie

Merge branch 'sy-add-alert-mau-aggrgation' into 'master'

Add aggregation metrics for alert actions and incident actions

See merge request gitlab-org/gitlab!48087
parents 127db4b9 ea1dcff6
......@@ -10,6 +10,7 @@ module Mutations
result = create_alert_issue(alert, current_user)
track_usage_event(:incident_management_incident_created, current_user.id)
track_usage_event(:incident_management_alert_create_incident, current_user.id)
prepare_response(alert, result)
end
......
---
title: Add metrics for count of unique users of alerts and incidents to usage ping
merge_request: 48087
author:
type: changed
---
name: usage_data_incident_management_alert_create_incident
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/48087
rollout_issue_url:
milestone: '13.7'
type: development
group: group::monitor
default_enabled: true
---
name: usage_data_incident_management_alerts_total_unique_counts
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/48087
rollout_issue_url:
milestone: '13.7'
type: development
group: group::monitor
default_enabled: false
---
name: usage_data_incident_management_incidents_total_unique_counts
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/48087
rollout_issue_url:
milestone: '13.7'
type: development
group: group::monitor
default_enabled: false
......@@ -15,3 +15,28 @@
- name: product_analytics_test_metrics_intersection
operator: AND
events: ['i_search_total', 'i_search_advanced', 'i_search_paid']
- name: incident_management_alerts_total_unique_counts
operator: OR
events: [
'incident_management_alert_status_changed',
'incident_management_alert_assigned',
'incident_management_alert_todo',
'incident_management_alert_create_incident'
]
feature_flag: usage_data_incident_management_alerts_total_unique_counts
- name: incident_management_incidents_total_unique_counts
operator: OR
events: [
'incident_management_incident_created',
'incident_management_incident_reopened',
'incident_management_incident_closed',
'incident_management_incident_assigned',
'incident_management_incident_todo',
'incident_management_incident_comment',
'incident_management_incident_zoom_meeting',
'incident_management_incident_published',
'incident_management_incident_relate',
'incident_management_incident_unrelate',
'incident_management_incident_change_confidential'
]
feature_flag: usage_data_incident_management_incidents_total_unique_counts
......@@ -229,6 +229,12 @@
category: incident_management
aggregation: weekly
feature_flag: usage_data_incident_management_incident_change_confidential
# Incident management alerts
- name: incident_management_alert_create_incident
redis_slot: incident_management
category: incident_management_alerts
aggregation: weekly
feature_flag: usage_data_incident_management_alert_create_incident
# Testing category
- name: i_testing_test_case_parsed
category: testing
......
......@@ -28,6 +28,7 @@ RSpec.describe Mutations::AlertManagement::CreateAlertIssue do
end
it_behaves_like 'an incident management tracked event', :incident_management_incident_created
it_behaves_like 'an incident management tracked event', :incident_management_alert_create_incident
end
context 'when CreateAlertIssue responds with an error' do
......
......@@ -8,7 +8,7 @@ RSpec.describe 'aggregated metrics' do
Gitlab::UsageDataCounters::HLLRedisCounter.known_event?(event)
end
failure_message do
failure_message do |event|
"Event with name: `#{event}` can not be found within `#{Gitlab::UsageDataCounters::HLLRedisCounter::KNOWN_EVENTS_PATH}`"
end
end
......
......@@ -30,6 +30,7 @@ RSpec.describe Gitlab::UsageDataCounters::HLLRedisCounter, :clean_gitlab_redis_s
'search',
'source_code',
'incident_management',
'incident_management_alerts',
'testing',
'issues_edit',
'ci_secrets_management',
......
......@@ -1235,7 +1235,7 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
subject { described_class.redis_hll_counters }
let(:categories) { ::Gitlab::UsageDataCounters::HLLRedisCounter.categories }
let(:ineligible_total_categories) { %w[source_code testing ci_secrets_management] }
let(:ineligible_total_categories) { %w[source_code testing ci_secrets_management incident_management_alerts] }
it 'has all known_events' do
expect(subject).to have_key(:redis_hll_counters)
......
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