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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-11-04 18:08:41 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-11-04 18:08:41 +0300
commit9ebfef6a3cf7184161c454c7667d151396e89137 (patch)
treea00337f95d0662c5d4433917ee04172ae82cc2de /lib/gitlab/tracking.rb
parent8a9cbfa9c56792d8e338c289eb803fb0ebde2083 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/tracking.rb')
-rw-r--r--lib/gitlab/tracking.rb25
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