summaryrefslogtreecommitdiff
path: root/app/services/notes/create_service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/notes/create_service.rb')
-rw-r--r--app/services/notes/create_service.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/services/notes/create_service.rb b/app/services/notes/create_service.rb
index c136803ef3b..9e6cbfa06fe 100644
--- a/app/services/notes/create_service.rb
+++ b/app/services/notes/create_service.rb
@@ -42,6 +42,10 @@ module Notes
clear_noteable_diffs_cache(note)
Suggestions::CreateService.new(note).execute
increment_usage_counter(note)
+
+ if Feature.enabled?(:notes_create_service_tracking, project)
+ Gitlab::Tracking.event('Notes::CreateService', 'execute', tracking_data_for(note))
+ end
end
if quick_actions_service.commands_executed_count.to_i > 0
@@ -59,5 +63,16 @@ module Notes
note
end
+
+ private
+
+ def tracking_data_for(note)
+ label = Gitlab.ee? && note.author == User.visual_review_bot ? 'anonymous_visual_review_note' : 'note'
+
+ {
+ label: label,
+ value: note.id
+ }
+ end
end
end