diff options
Diffstat (limited to 'doc/development/usage_ping/metrics_dictionary.md')
-rw-r--r-- | doc/development/usage_ping/metrics_dictionary.md | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/doc/development/usage_ping/metrics_dictionary.md b/doc/development/usage_ping/metrics_dictionary.md index 406a223b204..3c08fb0cc87 100644 --- a/doc/development/usage_ping/metrics_dictionary.md +++ b/doc/development/usage_ping/metrics_dictionary.md @@ -28,20 +28,22 @@ Each metric is defined in a separate YAML file consisting of a number of fields: |---------------------|----------|----------------------------------------------------------------| | `key_path` | yes | JSON key path for the metric, location in Usage Ping payload. | | `description` | yes | | -| `value_type` | yes | | -| `status` | yes | | -| `product_group` | yes | The [group](https://about.gitlab.com/handbook/product/categories/#devops-stages) that owns the metric. | -| `time_frame` | yes | `string`; may be set to a value like "7d" | -| `data_source` | yes | `string`: may be set to a value like `database` or `redis_hll`. | -| `distribution` | yes | The [distribution](https://about.gitlab.com/handbook/marketing/strategic-marketing/tiers/#definitions) where the metric applies. | -| `tier` | yes | The [tier]( https://about.gitlab.com/handbook/marketing/strategic-marketing/tiers/) where the metric applies. | -| `product_category` | no | The [product category](https://gitlab.com/gitlab-com/www-gitlab-com/blob/master/data/categories.yml) for the metric. | +| `product_section` | yes | The [section](https://gitlab.com/gitlab-com/www-gitlab-com/-/blob/master/data/sections.yml). | | `product_stage` | no | The [stage](https://gitlab.com/gitlab-com/www-gitlab-com/blob/master/data/stages.yml) for the metric. | +| `product_group` | yes | The [group](https://gitlab.com/gitlab-com/www-gitlab-com/blob/master/data/stages.yml) that owns the metric. | +| `product_category` | no | The [product category](https://gitlab.com/gitlab-com/www-gitlab-com/blob/master/data/categories.yml) for the metric. | +| `value_type` | yes | `string`; one of `string`, `number`, `boolean`, `object`. | +| `status` | yes | `string`; status of the metric, may be set to `data_available`, `planned`, `in_progress`, `implemented`, `not_used`, `deprecated` | +| `time_frame` | yes | `string`; may be set to a value like `7d`, `28d`, `all`, `none`. | +| `data_source` | yes | `string`; may be set to a value like `database`, `redis`, `redis_hll`, `prometheus`, `ruby`. | +| `distribution` | yes | `array`; may be set to one of `ce, ee` or `ee`. The [distribution](https://about.gitlab.com/handbook/marketing/strategic-marketing/tiers/#definitions) where the tracked feature is available. | +| `tier` | yes | `array`; may be set to one of `free, premium, ultimate`, `premium, ultimate` or `ultimate`. The [tier]( https://about.gitlab.com/handbook/marketing/strategic-marketing/tiers/) where the tracked feature is available. | | `milestone` | no | The milestone when the metric is introduced. | | `milestone_removed` | no | The milestone when the metric is removed. | | `introduced_by_url` | no | The URL to the Merge Request that introduced the metric. | +| `skip_validation` | no | This should **not** be set. [Used for imported metrics until we review, update and make them valid](https://gitlab.com/groups/gitlab-org/-/epics/5425). | -### Example metric definition +### Example YAML metric definition The linked [`uuid`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/license/uuid.yml) YAML file includes an example metric definition, where the `uuid` metric is the GitLab @@ -50,18 +52,19 @@ instance unique identifier. ```yaml key_path: uuid description: GitLab instance unique identifier -value_type: string product_category: collection +product_section: growth product_stage: growth +product_group: group::product intelligence +value_type: string status: data_available milestone: 9.1 introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/1521 -product_group: group::product intelligence time_frame: none data_source: database distribution: -- ee - ce +- ee tier: - free - premium @@ -91,3 +94,9 @@ To create a metric definition used in EE, add the `--ee` flag. bundle exec rails generate gitlab:usage_metric_definition counts.issues --ee --dir=7d create ee/config/metrics/counts_7d/issues.yml ``` + +## Metrics added dynamic to Usage Ping payload + +The [Redis HLL metrics](index.md#known-events-are-added-automatically-in-usage-data-payload) are added automatically to Usage Ping payload. + +A YAML metric definition is required for each metric. |