Commit 36f30dac authored by Markus Koller's avatar Markus Koller

Merge branch 'gitlab-tracking-meta-3' into 'master'

Update tracking calls with user, namespace and project

See merge request gitlab-org/gitlab!63283
parents 4c75c7d2 ce5fadfe
......@@ -47,11 +47,11 @@ module Issues
attr_reader :issue
def track_meeting_added_event
::Gitlab::Tracking.event('IncidentManagement::ZoomIntegration', 'add_zoom_meeting', label: 'Issue ID', value: issue.id)
::Gitlab::Tracking.event('IncidentManagement::ZoomIntegration', 'add_zoom_meeting', label: 'Issue ID', value: issue.id, user: current_user, project: @project, namespace: @project.namespace)
end
def track_meeting_removed_event
::Gitlab::Tracking.event('IncidentManagement::ZoomIntegration', 'remove_zoom_meeting', label: 'Issue ID', value: issue.id)
::Gitlab::Tracking.event('IncidentManagement::ZoomIntegration', 'remove_zoom_meeting', label: 'Issue ID', value: issue.id, user: current_user, project: @project, namespace: @project.namespace)
end
def add_zoom_meeting(link)
......
......@@ -75,7 +75,7 @@ module Members
def after_execute(member:)
super
Gitlab::Tracking.event(self.class.name, 'create_member', label: invite_source, property: tracking_property(member))
Gitlab::Tracking.event(self.class.name, 'create_member', label: invite_source, property: tracking_property(member), user: current_user)
end
def invite_source
......
......@@ -12,7 +12,7 @@ module GroupInviteMembers
result = Members::CreateService.new(current_user, invite_params).execute
::Gitlab::Tracking.event(self.class.name, 'invite_members', label: 'new_group_form') if result[:status] == :success
::Gitlab::Tracking.event(self.class.name, 'invite_members', label: 'new_group_form', user: current_user) if result[:status] == :success
end
def emails_param
......
......@@ -52,7 +52,9 @@ class Groups::Analytics::CoverageReportsController < Groups::Analytics::Applicat
def download_tracker_params
{
label: 'group_id',
value: @group.id
value: @group.id,
user: current_user,
namespace: @group
}
end
end
......@@ -19,7 +19,9 @@ class Groups::Analytics::RepositoryAnalyticsController < Groups::Analytics::Appl
def pageview_tracker_params
{
label: 'group_id',
value: @group.id
value: @group.id,
user: current_user,
namespace: @group
}
end
end
......@@ -66,7 +66,9 @@ RSpec.describe Groups::Analytics::CoverageReportsController do
category: described_class.name,
action: 'download_code_coverage_csv',
label: 'group_id',
value: group.id
value: group.id,
user: user,
namespace: group
)
expect(response).to have_gitlab_http_status(:ok)
......
......@@ -29,7 +29,9 @@ RSpec.describe Groups::Analytics::RepositoryAnalyticsController do
category: 'Groups::Analytics::RepositoryAnalyticsController',
action: 'show',
label: 'group_id',
value: group.id
value: group.id,
namespace: group,
user: current_user
)
end
......
......@@ -32,7 +32,7 @@ RSpec.shared_examples GroupInviteMembers do
it 'tracks the event' do
subject
expect_snowplow_event(category: anything, action: 'invite_members', label: 'new_group_form')
expect_snowplow_event(category: anything, action: 'invite_members', label: 'new_group_form', user: user)
end
end
end
......
......@@ -117,7 +117,7 @@ module API
not_allowed! # This currently can only be reached in EE
elsif member.valid? && member.persisted?
present_members(member)
Gitlab::Tracking.event(::Members::CreateService.name, 'create_member', label: params[:invite_source], property: 'existing_user')
Gitlab::Tracking.event(::Members::CreateService.name, 'create_member', label: params[:invite_source], property: 'existing_user', user: current_user)
else
render_validation_error!(member)
end
......
......@@ -162,7 +162,8 @@ RSpec.describe API::Invitations do
category: 'Members::InviteService',
action: 'create_member',
label: 'api',
property: 'net_new_user'
property: 'net_new_user',
user: maintainer
)
end
......@@ -173,7 +174,8 @@ RSpec.describe API::Invitations do
category: 'Members::InviteService',
action: 'create_member',
label: '_invite_source_',
property: 'net_new_user'
property: 'net_new_user',
user: maintainer
)
end
end
......
......@@ -266,7 +266,8 @@ RSpec.describe API::Members do
category: 'Members::CreateService',
action: 'create_member',
label: 'api',
property: 'existing_user'
property: 'existing_user',
user: maintainer
)
end
......@@ -278,7 +279,8 @@ RSpec.describe API::Members do
category: 'Members::CreateService',
action: 'create_member',
label: '_invite_source_',
property: 'existing_user'
property: 'existing_user',
user: maintainer
)
end
end
......@@ -321,7 +323,8 @@ RSpec.describe API::Members do
category: 'Members::CreateService',
action: 'create_member',
label: 'api',
property: 'existing_user'
property: 'existing_user',
user: maintainer
)
end
......@@ -333,7 +336,8 @@ RSpec.describe API::Members do
category: 'Members::CreateService',
action: 'create_member',
label: '_invite_source_',
property: 'existing_user'
property: 'existing_user',
user: maintainer
)
end
end
......
......@@ -53,7 +53,10 @@ RSpec.describe Issues::ZoomLinkService do
category: 'IncidentManagement::ZoomIntegration',
action: 'add_zoom_meeting',
label: 'Issue ID',
value: issue.id
value: issue.id,
user: user,
project: project,
namespace: project.namespace
)
end
......@@ -192,7 +195,10 @@ RSpec.describe Issues::ZoomLinkService do
category: 'IncidentManagement::ZoomIntegration',
action: 'remove_zoom_meeting',
label: 'Issue ID',
value: issue.id
value: issue.id,
user: user,
project: project,
namespace: project.namespace
)
end
end
......
......@@ -93,7 +93,8 @@ RSpec.describe Members::CreateService, :aggregate_failures, :clean_gitlab_redis_
category: described_class.name,
action: 'create_member',
label: 'unknown',
property: 'existing_user'
property: 'existing_user',
user: user
)
end
end
......@@ -108,7 +109,8 @@ RSpec.describe Members::CreateService, :aggregate_failures, :clean_gitlab_redis_
category: described_class.name,
action: 'create_member',
label: '_invite_source_',
property: 'existing_user'
property: 'existing_user',
user: user
)
end
end
......@@ -123,7 +125,8 @@ RSpec.describe Members::CreateService, :aggregate_failures, :clean_gitlab_redis_
category: described_class.name,
action: 'create_member',
label: 'unknown',
property: 'net_new_user'
property: 'net_new_user',
user: user
)
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment