diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-16 00:07:28 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-16 00:07:28 +0300 |
commit | d22c6f7410966b5288a8b8e904cd24758e9cec50 (patch) | |
tree | b54768ea1b03a1affb798898e2cf81fd1259e80b /lib/gitlab/tracking | |
parent | a84aefe0bb8fc2ad47ab67cb4ddcfbb7aecfbd5e (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/tracking')
-rw-r--r-- | lib/gitlab/tracking/destinations/snowplow.rb | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/lib/gitlab/tracking/destinations/snowplow.rb b/lib/gitlab/tracking/destinations/snowplow.rb index ddcd4693738..fd877bc0137 100644 --- a/lib/gitlab/tracking/destinations/snowplow.rb +++ b/lib/gitlab/tracking/destinations/snowplow.rb @@ -14,7 +14,15 @@ module Gitlab def event(category, action, label: nil, property: nil, value: nil, context: nil) return unless enabled? - tracker.track_struct_event(category, action, label, property, value, context, (Time.now.to_f * 1000).to_i) + tracker.track_struct_event( + category: category, + action: action, + label: label, + property: property, + value: value, + context: context, + tstamp: (Time.now.to_f * 1000).to_i + ) increment_total_events_counter end @@ -54,19 +62,21 @@ module Gitlab def tracker @tracker ||= SnowplowTracker::Tracker.new( - emitter, - SnowplowTracker::Subject.new, - SNOWPLOW_NAMESPACE, - app_id + emitters: [emitter], + subject: SnowplowTracker::Subject.new, + namespace: SNOWPLOW_NAMESPACE, + app_id: app_id ) end def emitter SnowplowTracker::AsyncEmitter.new( - hostname, - protocol: protocol, - on_success: method(:increment_successful_events_emissions), - on_failure: method(:failure_callback) + endpoint: hostname, + options: { + protocol: protocol, + on_success: method(:increment_successful_events_emissions), + on_failure: method(:failure_callback) + } ) end |