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
path: root/doc
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2016-09-12 18:41:32 +0300
committerYorick Peterse <yorickpeterse@gmail.com>2016-09-12 18:41:45 +0300
commit0c046399d4361e2f3d8943efddd2ef4fd3b2152f (patch)
tree8c56c76b510cb2871c478be731cf4164061988b3 /doc
parent12d4eea4c7a46ad3641f2c3a8ee182a16e4848e5 (diff)
Document how to track custom events
Fixes gitlab-org/gitlab-ce#22070 [ci skip]
Diffstat (limited to 'doc')
-rw-r--r--doc/development/instrumentation.md15
1 files changed, 15 insertions, 0 deletions
diff --git a/doc/development/instrumentation.md b/doc/development/instrumentation.md
index c2272ab0a2b..105e2f1242a 100644
--- a/doc/development/instrumentation.md
+++ b/doc/development/instrumentation.md
@@ -137,3 +137,18 @@ end
```
Here the final value of `sleep_real_time` will be `3`, _not_ `1`.
+
+## Tracking Custom Events
+
+Besides instrumenting code GitLab Performance Monitoring also supports tracking
+of custom events. This is primarily intended to be used for tracking business
+metrics such as the number of Git pushes, repository imports, and so on.
+
+To track a custom event simply call `Gitlab::Metrics.add_event` passing it an
+event name and a custom set of (optional) tags. For example:
+
+```ruby
+Gitlab::Metrics.add_event(:user_login, email: current_user.email)
+```
+
+Event names should be verbs such as `push_repository` and `remove_branch`.