Welcome to mirror list, hosted at ThFree Co, Russian Federation.

usage_data.rb « incident_management « concerns « services « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 40183085344adf46153b82a495d99e7a60c7ba34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# frozen_string_literal: true

module IncidentManagement
  module UsageData
    include Gitlab::Utils::UsageData

    def track_incident_action(current_user, target, action)
      return unless target.incident?

      event = "incident_management_#{action}"
      track_usage_event(event, current_user.id)

      namespace = target.try(:namespace)
      project = target.try(:project)

      return unless Feature.enabled?(:route_hll_to_snowplow_phase2, target.try(:namespace))

      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]
      )
    end
  end
end