Commit 0ac914e3 authored by Fiona Neill's avatar Fiona Neill

Merge branch '340847-remove-deprecated-metric-status-2' into 'master'

Remove deprecated metric status from documentation

See merge request gitlab-org/gitlab!76070
parents c0b28915 e918f3c2
......@@ -55,23 +55,24 @@ The correct approach is to add a new metric for GitLab 12.6 release with updated
and update existing business analysis artefacts to use `example_metric_without_archived` instead of `example_metric`
## Deprecate a metric
## Remove a metric
WARNING:
If a metric is not used in Sisense or any other system after 6 months, the
Product Intelligence team marks it as inactive and assigns it to the group owner for review.
We are working on automating this process. See [this issue](https://gitlab.com/gitlab-org/gitlab/-/issues/338466) for details.
If a metric is obsolete and you no longer use it, you can mark it as deprecated.
Product Intelligence removes metrics from Service Ping if they are not used in any Sisense dashboard.
For an example of the metric deprecation process take a look at this [example merge request](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/59899)
For an example of the metric removal process, see this [example issue](https://gitlab.com/gitlab-org/gitlab/-/issues/297029).
To deprecate a metric:
To remove a metric:
1. Check the following YAML files and verify the metric is not used in an aggregate:
- [`config/metrics/aggregates/*.yaml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/aggregates/)
- [`ee/config/metrics/aggregates/*.yaml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/aggregates/)
1. Create an issue in the [GitLab Data Team
project](https://gitlab.com/gitlab-data/analytics/-/issues). Ask for
confirmation that the metric is not used by other teams, or in any of the SiSense
dashboards.
1. Verify the metric is not used to calculate the conversational index. The
conversational index is a measure that reports back to self-managed instances
to inform administrators of the progress of DevOps adoption for the instance.
......@@ -81,70 +82,6 @@ To deprecate a metric:
to view the metrics that are used. The metrics are represented
as the keys that are passed as a field argument into the `get_value` method.
1. Document the deprecation in the metric's YAML definition. Set
the `status:` attribute to `deprecated`, for example:
```yaml
---
key_path: analytics_unique_visits.analytics_unique_visits_for_any_target_monthly
description: Visits to any of the pages listed above per month
product_section: dev
product_stage: manage
product_group: group::analytics
product_category:
value_type: number
status: deprecated
time_frame: 28d
data_source:
distribution:
- ce
tier:
- free
```
1. Replace the metric's instrumentation with a fixed value. This avoids wasting
resources to calculate the deprecated metric. In
[`lib/gitlab/usage_data.rb`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/usage_data.rb)
or
[`ee/lib/ee/gitlab/usage_data.rb`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/lib/ee/gitlab/usage_data.rb),
replace the code that calculates the metric's value with a fixed value that
indicates it's deprecated:
```ruby
module Gitlab
class UsageData
DEPRECATED_VALUE = -1000
def analytics_unique_visits_data
results['analytics_unique_visits_for_any_target'] = redis_usage_data { unique_visit_service.unique_visits_for(targets: :analytics) }
results['analytics_unique_visits_for_any_target_monthly'] = DEPRECATED_VALUE
{ analytics_unique_visits: results }
end
# ...
end
end
```
## Remove a metric
### Removal policy
WARNING:
A metric that is not used in Sisense or any other system after 6 months is marked by the
Product Intelligence team as inactive and is assigned to the group owner for review.
We are working on automating this process. See [this issue](https://gitlab.com/gitlab-org/gitlab/-/issues/338466) for details.
Metrics can be removed from Service Ping if they:
- Were previously [deprecated](#deprecate-a-metric).
- Are not used in any Sisense dashboard.
For an example of the metric removal process take a look at this [example issue](https://gitlab.com/gitlab-org/gitlab/-/issues/297029)
### To remove a deprecated metric
1. Verify that removing the metric from the Service Ping payload does not cause
errors in [Version App](https://gitlab.com/gitlab-services/version-gitlab-com)
when the updated payload is collected and processed. Version App collects
......@@ -159,9 +96,6 @@ For an example of the metric removal process take a look at this [example issue]
Ask for confirmation that the metric is not referred to in any SiSense dashboards and
can be safely removed from Service Ping. Use this
[example issue](https://gitlab.com/gitlab-data/analytics/-/issues/7539) for guidance.
This step can be skipped if verification done during [deprecation process](#deprecate-a-metric)
reported that metric is not required by any data transformation in Snowflake data warehouse nor it is
used by any of SiSense dashboards.
1. After you verify the metric can be safely removed,
update the attributes of the metric's YAML definition:
......
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