Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
0c046399
Commit
0c046399
authored
Sep 12, 2016
by
Yorick Peterse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document how to track custom events
Fixes gitlab-org/gitlab-ce#22070 [ci skip]
parent
12d4eea4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
doc/development/instrumentation.md
doc/development/instrumentation.md
+15
-0
No files found.
doc/development/instrumentation.md
View file @
0c046399
...
...
@@ -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`
.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment