debian-mirror-gitlab/app/services/concerns/incident_management/usage_data.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
792 B
Ruby
Raw Normal View History

2020-11-24 15:15:51 +05:30
# frozen_string_literal: true
module IncidentManagement
module UsageData
include Gitlab::Utils::UsageData
def track_incident_action(current_user, target, action)
2023-07-09 08:55:56 +05:30
return unless target.incident_type_issue?
2020-11-24 15:15:51 +05:30
2023-03-04 22:38:38 +05:30
event = "incident_management_#{action}"
track_usage_event(event, current_user.id)
namespace = target.try(:namespace)
project = target.try(:project)
Gitlab::Tracking.event(
self.class.to_s,
event,
project: project,
namespace: namespace,
user: current_user,
label: 'redis_hll_counters.incident_management.incident_management_total_unique_counts_monthly',
context: [Gitlab::Tracking::ServicePingContext.new(data_source: :redis_hll, event: event).to_context]
)
2020-11-24 15:15:51 +05:30
end
end
end