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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
24b6f3ed
Commit
24b6f3ed
authored
Feb 22, 2021
by
Alper Akgun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Docs for usage data add method
parent
8601c224
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
doc/development/usage_ping.md
doc/development/usage_ping.md
+12
-1
No files found.
doc/development/usage_ping.md
View file @
24b6f3ed
...
...
@@ -742,7 +742,7 @@ Arguments:
- or a `
block
`: which is evaluated
- `
fallback: -1
`: the common value used for any metrics that are failing.
Example of u
sage:
U
sage:
```ruby
alt_usage_data { Gitlab::VERSION }
...
...
@@ -750,6 +750,17 @@ alt_usage_data { Gitlab::CurrentSettings.uuid }
alt_usage_data(999)
```
### Adding counters to build new metrics
When adding the results of two counters, use the `
add
` usage data method that
handles fallback values and exceptions. It also generates a valid SQL export.
Example usage:
```ruby
add(User.active, User.bot)
```
### Prometheus Queries
In those cases where operational metrics should be part of Usage Ping, a database or Redis query is unlikely
...
...
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