Commit 24b6f3ed authored by Alper Akgun's avatar Alper Akgun

Docs for usage data add method

parent 8601c224
......@@ -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 }
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment