Commit f1e45425 authored by Piotr Skorupa's avatar Piotr Skorupa

Remove namespaces in metric definitions instrumentation_class

parent 7368e2a6
...@@ -9,7 +9,7 @@ value_type: number ...@@ -9,7 +9,7 @@ value_type: number
status: data_available status: data_available
time_frame: 28d time_frame: 28d
data_source: database data_source: database
instrumentation_class: 'Gitlab::Usage::Metrics::Instrumentations::CountUsersCreatingIssuesMetric' instrumentation_class: CountUsersCreatingIssuesMetric
distribution: distribution:
- ce - ce
- ee - ee
......
...@@ -9,7 +9,7 @@ value_type: number ...@@ -9,7 +9,7 @@ value_type: number
status: data_available status: data_available
time_frame: 28d time_frame: 28d
data_source: redis_hll data_source: redis_hll
instrumentation_class: 'Gitlab::Usage::Metrics::Instrumentations::CountUsersUsingApproveQuickActionMetric' instrumentation_class: CountUsersUsingApproveQuickActionMetric
distribution: distribution:
- ce - ce
- ee - ee
......
...@@ -9,7 +9,7 @@ value_type: number ...@@ -9,7 +9,7 @@ value_type: number
status: data_available status: data_available
time_frame: 7d time_frame: 7d
data_source: redis_hll data_source: redis_hll
instrumentation_class: 'Gitlab::Usage::Metrics::Instrumentations::CountUsersUsingApproveQuickActionMetric' instrumentation_class: CountUsersUsingApproveQuickActionMetric
distribution: distribution:
- ce - ce
- ee - ee
......
...@@ -9,7 +9,7 @@ value_type: number ...@@ -9,7 +9,7 @@ value_type: number
status: data_available status: data_available
time_frame: all time_frame: all
data_source: database data_source: database
instrumentation_class: 'Gitlab::Usage::Metrics::Instrumentations::CountIssuesMetric' instrumentation_class: CountIssuesMetric
distribution: distribution:
- ce - ce
- ee - ee
......
...@@ -9,7 +9,7 @@ value_type: number ...@@ -9,7 +9,7 @@ value_type: number
status: data_available status: data_available
time_frame: all time_frame: all
data_source: database data_source: database
instrumentation_class: 'Gitlab::Usage::Metrics::Instrumentations::CountUsersCreatingIssuesMetric' instrumentation_class: CountUsersCreatingIssuesMetric
distribution: distribution:
- ce - ce
- ee - ee
......
...@@ -9,7 +9,7 @@ value_type: number ...@@ -9,7 +9,7 @@ value_type: number
status: data_available status: data_available
time_frame: all time_frame: all
data_source: database data_source: database
instrumentation_class: 'Gitlab::Usage::Metrics::Instrumentations::CountBoardsMetric' instrumentation_class: CountBoardsMetric
distribution: distribution:
- ce - ce
- ee - ee
......
...@@ -11,7 +11,7 @@ milestone: "9.1" ...@@ -11,7 +11,7 @@ milestone: "9.1"
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/1521 introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/1521
time_frame: none time_frame: none
data_source: database data_source: database
instrumentation_class: 'Gitlab::Usage::Metrics::Instrumentations::UuidMetric' instrumentation_class: UuidMetric
distribution: distribution:
- ee - ee
- ce - ce
......
...@@ -9,7 +9,7 @@ value_type: string ...@@ -9,7 +9,7 @@ value_type: string
status: data_available status: data_available
time_frame: none time_frame: none
data_source: system data_source: system
instrumentation_class: 'Gitlab::Usage::Metrics::Instrumentations::HostnameMetric' instrumentation_class: HostnameMetric
distribution: distribution:
- ce - ce
- ee - ee
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
}, },
"instrumentation_class": { "instrumentation_class": {
"type": "string", "type": "string",
"pattern": "^(Gitlab::Usage::Metrics::Instrumentations::)(([A-Z][a-z]+)+::)*(([A-Z][a-z]+)+)$" "pattern": "^(([A-Z][a-z]+)+::)*(([A-Z][a-z]+)+)$"
}, },
"distribution": { "distribution": {
"type": "array", "type": "array",
......
...@@ -9,7 +9,7 @@ module Gitlab ...@@ -9,7 +9,7 @@ module Gitlab
instrumentation_class = definition.attributes[:instrumentation_class] instrumentation_class = definition.attributes[:instrumentation_class]
if instrumentation_class.present? if instrumentation_class.present?
metric_value = instrumentation_class.constantize.new(time_frame: definition.attributes[:time_frame]).value metric_value = "Gitlab::Usage::Metrics::Instrumentations::#{instrumentation_class}".constantize.new(time_frame: definition.attributes[:time_frame]).value
metric_payload(definition.key_path, metric_value) metric_payload(definition.key_path, metric_value)
else else
......
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