Draft: Add <name>_metric.yml file for usage data metrics definition
What does this MR do?
Add base for having yml metrics files
The metric identifier(the metric key) is based on default_generation
and full_path
attributes. The key is the default generation full path
Questions
How to use this yml file?
- we could have a rake task to build the metrics dictionary from the metrics yml files, where should this file live and what should be the format? How should make this easy visible?
Notes
-
Check complex metrics definitions -
Consider ee metrics
Example of metrics definitions
[7] pry(main)> Gitlab::UsageData::Metric::Definition.definitions
=> {"database.adapter"=>
#<Gitlab::UsageData::Metric::Definition:0x00007ffcc8ff6370
@attributes=
{:name=>"adapter",
:description=>"The version of the PostgreSQL database",
:default_generation=>"generation_1",
:full_path=>{:generation_1=>"database.adapter"},
:milestone=>nil,
:introduced_by_url=>nil,
:group=>"group::enablement distribution",
:time_frame=>nil,
:distribution=>["ee", "ce"],
:tier=>["free", "starter", "premium", "ultimate", "bronze", "silver", "gold"],
:type=>"settings",
:data_source=>nil},
@path="/Users/alina/Documents/work/gitlab-development-kit/gitlab/lib/gitlab/usage_data/metrics_definitions/settings/database_adapter.yml">,
"recorded_at"=>
#<Gitlab::UsageData::Metric::Definition:0x00007ffcc8ff4b38
@attributes=
{:name=>"recorded_at",
:description=>"Time when usage data is recorded",
:default_generation=>"generation_1",
:full_path=>{:generation_1=>"recorded_at", :generation_2=>"license.recorded_at"},
:milestone=>nil,
:introduced_by_url=>nil,
:group=>"group::product analytics",
:time_frame=>nil,
:distribution=>["ee", "ce"],
:tier=>["free", "starter", "premium", "ultimate", "bronze", "silver", "gold"],
:type=>"license",
:data_source=>nil},
@path="/Users/alina/Documents/work/gitlab-development-kit/gitlab/lib/gitlab/usage_data/metrics_definitions/license/recorded_at.yml">,
"counts.deployments"=>
#<Gitlab::UsageData::Metric::Definition:0x00007ffcba9e3478
@attributes=
{:name=>"deployments",
Screenshots (strongly suggested)
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Related to #270107 (closed)
Edited by Alina Mihaila