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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/tracking/destinations/snowplow.rb')
-rw-r--r--lib/gitlab/tracking/destinations/snowplow.rb28
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