diff options
Diffstat (limited to 'lib/gitlab/tracking.rb')
-rw-r--r-- | lib/gitlab/tracking.rb | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/lib/gitlab/tracking.rb b/lib/gitlab/tracking.rb index 02d354ec43a..19be468e3d5 100644 --- a/lib/gitlab/tracking.rb +++ b/lib/gitlab/tracking.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'snowplow-tracker' - module Gitlab module Tracking SNOWPLOW_NAMESPACE = 'gl' @@ -27,16 +25,11 @@ module Gitlab end def event(category, action, label: nil, property: nil, value: nil, context: nil) - return unless enabled? - - snowplow.track_struct_event(category, action, label, property, value, context, (Time.now.to_f * 1000).to_i) + snowplow.event(category, action, label: label, property: property, value: value, context: context) end def self_describing_event(schema_url, event_data_json, context: nil) - return unless enabled? - - event_json = SnowplowTracker::SelfDescribingJson.new(schema_url, event_data_json) - snowplow.track_self_describing_event(event_json, context, (Time.now.to_f * 1000).to_i) + snowplow.self_describing_event(schema_url, event_data_json, context: context) end def snowplow_options(group) @@ -54,19 +47,7 @@ module Gitlab private def snowplow - @snowplow ||= SnowplowTracker::Tracker.new( - emitter, - SnowplowTracker::Subject.new, - SNOWPLOW_NAMESPACE, - Gitlab::CurrentSettings.snowplow_app_id - ) - end - - def emitter - SnowplowTracker::AsyncEmitter.new( - Gitlab::CurrentSettings.snowplow_collector_hostname, - protocol: 'https' - ) + @snowplow ||= Gitlab::Tracking::Destinations::Snowplow.new end end end |