Skip to content
Snippets Groups Projects
Commit 24b6f3ed authored by Alper Akgun's avatar Alper Akgun
Browse files

Docs for usage data add method

parent 8601c224
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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 usage:
Usage:
 
```ruby
alt_usage_data { Gitlab::VERSION }
Loading
Loading
@@ -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
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment