diff options
Diffstat (limited to 'lib/gitlab/tracking.rb')
| -rw-r--r-- | lib/gitlab/tracking.rb | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/lib/gitlab/tracking.rb b/lib/gitlab/tracking.rb index deef3a9a38b..52aee4d2d45 100644 --- a/lib/gitlab/tracking.rb +++ b/lib/gitlab/tracking.rb @@ -9,11 +9,15 @@ module Gitlab def event(category, action, label: nil, property: nil, value: nil, context: [], project: nil, user: nil, namespace: nil, **extra) # rubocop:disable Metrics/ParameterLists action = action.to_s + + project_id = project.is_a?(Integer) ? project : project&.id + contexts = [ Tracking::StandardContext.new( - project: project, - user: user, - namespace: namespace, + namespace_id: namespace&.id, + plan_name: namespace&.actual_plan_name, + project_id: project_id, + user_id: user&.id, **extra).to_context, *context ] @@ -25,9 +29,10 @@ module Gitlab destination = Gitlab::Tracking::Destinations::DatabaseEventsSnowplow.new contexts = [ Tracking::StandardContext.new( - project: project, - user: user, - namespace: namespace, + namespace_id: namespace&.id, + plan_name: namespace&.actual_plan_name, + project_id: project&.id, + user_id: user&.id, **extra).to_context, *context ] |
