summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2018-06-19 19:03:25 +0200
committerYorick Peterse <yorickpeterse@gmail.com>2018-06-21 16:56:40 +0200
commit9e29408ee6072f2559899582b3300a6de54069ff (patch)
tree921e3aa0bf3ebe9b61b74973c239b8108de4175b /app
parentd229e7d3f50fd1f36bacecd55bb74d0b1ab44cbe (diff)
downloadgitlab-ce-9e29408ee6072f2559899582b3300a6de54069ff.tar.gz
Don't expose project names in various counters
Various counters would expose either project names, or full project paths (e.g. "gitlab-org/gitlab-ce"). This commit changes various places where we use "add_event" so we no longer expose (potentially) private information.
Diffstat (limited to 'app')
-rw-r--r--app/models/remote_mirror.rb6
-rw-r--r--app/models/repository.rb2
-rw-r--r--app/workers/concerns/gitlab/github_import/object_importer.rb2
-rw-r--r--app/workers/repository_fork_worker.rb4
-rw-r--r--app/workers/repository_import_worker.rb4
5 files changed, 7 insertions, 11 deletions
diff --git a/app/models/remote_mirror.rb b/app/models/remote_mirror.rb
index c4b5dd2dc96..67e05cfaf93 100644
--- a/app/models/remote_mirror.rb
+++ b/app/models/remote_mirror.rb
@@ -48,13 +48,13 @@ class RemoteMirror < ActiveRecord::Base
state :failed
after_transition any => :started do |remote_mirror, _|
- Gitlab::Metrics.add_event(:remote_mirrors_running, path: remote_mirror.project.full_path)
+ Gitlab::Metrics.add_event(:remote_mirrors_running)
remote_mirror.update(last_update_started_at: Time.now)
end
after_transition started: :finished do |remote_mirror, _|
- Gitlab::Metrics.add_event(:remote_mirrors_finished, path: remote_mirror.project.full_path)
+ Gitlab::Metrics.add_event(:remote_mirrors_finished)
timestamp = Time.now
remote_mirror.update_attributes!(
@@ -63,7 +63,7 @@ class RemoteMirror < ActiveRecord::Base
end
after_transition started: :failed do |remote_mirror, _|
- Gitlab::Metrics.add_event(:remote_mirrors_failed, path: remote_mirror.project.full_path)
+ Gitlab::Metrics.add_event(:remote_mirrors_failed)
remote_mirror.update(last_update_at: Time.now)
end
diff --git a/app/models/repository.rb b/app/models/repository.rb
index e4202505634..722f87a9d29 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -1025,7 +1025,7 @@ class Repository
end
def repository_event(event, tags = {})
- Gitlab::Metrics.add_event(event, { path: full_path }.merge(tags))
+ Gitlab::Metrics.add_event(event, tags)
end
def initialize_raw_repository
diff --git a/app/workers/concerns/gitlab/github_import/object_importer.rb b/app/workers/concerns/gitlab/github_import/object_importer.rb
index 100d86e38c8..eeeff6e93a0 100644
--- a/app/workers/concerns/gitlab/github_import/object_importer.rb
+++ b/app/workers/concerns/gitlab/github_import/object_importer.rb
@@ -22,7 +22,7 @@ module Gitlab
importer_class.new(object, project, client).execute
- counter.increment(project: project.full_path)
+ counter.increment
end
def counter
diff --git a/app/workers/repository_fork_worker.rb b/app/workers/repository_fork_worker.rb
index dbb215f1964..7eeca4b734d 100644
--- a/app/workers/repository_fork_worker.rb
+++ b/app/workers/repository_fork_worker.rb
@@ -21,9 +21,7 @@ class RepositoryForkWorker
def fork_repository(target_project, source_repository_storage_name, source_disk_path)
return unless start_fork(target_project)
- Gitlab::Metrics.add_event(:fork_repository,
- source_path: source_disk_path,
- target_path: target_project.disk_path)
+ Gitlab::Metrics.add_event(:fork_repository)
result = gitlab_shell.fork_repository(source_repository_storage_name, source_disk_path,
target_project.repository_storage, target_project.disk_path)
diff --git a/app/workers/repository_import_worker.rb b/app/workers/repository_import_worker.rb
index d79b5ee5346..973d76ee67b 100644
--- a/app/workers/repository_import_worker.rb
+++ b/app/workers/repository_import_worker.rb
@@ -9,9 +9,7 @@ class RepositoryImportWorker
return unless start_import(project)
- Gitlab::Metrics.add_event(:import_repository,
- import_url: project.import_url,
- path: project.full_path)
+ Gitlab::Metrics.add_event(:import_repository)
service = Projects::ImportService.new(project, project.creator)
result = service.execute