diff --git a/src/spaceone/inventory/managed_resource/metric/iam_service_account_count.yaml b/src/spaceone/inventory/managed_resource/metric/iam_service_account_count.yaml index cbfefe02..d57ac78f 100644 --- a/src/spaceone/inventory/managed_resource/metric/iam_service_account_count.yaml +++ b/src/spaceone/inventory/managed_resource/metric/iam_service_account_count.yaml @@ -5,8 +5,6 @@ metric_type: GAUGE resource_type: identity.ServiceAccount query_options: group_by: - - key: workspace_id - name: Workspace ID - key: provider name: Provider default: true @@ -19,4 +17,4 @@ query_options: operator: count unit: Count namespace_id: ns-managed-iam-summary -version: '1.0' \ No newline at end of file +version: '1.1' \ No newline at end of file diff --git a/src/spaceone/inventory/manager/metric_manager.py b/src/spaceone/inventory/manager/metric_manager.py index 61b4a775..bdcd18ae 100644 --- a/src/spaceone/inventory/manager/metric_manager.py +++ b/src/spaceone/inventory/manager/metric_manager.py @@ -720,6 +720,7 @@ def _get_labels_info(query_options: dict) -> list: @staticmethod def _analyze_service_accounts(query: dict, domain_id: str) -> list: default_group_by = [ + "service_account_id", "project_id", "workspace_id", ] diff --git a/src/spaceone/inventory/model/metric/database.py b/src/spaceone/inventory/model/metric/database.py index e762218b..a9ce15a1 100644 --- a/src/spaceone/inventory/model/metric/database.py +++ b/src/spaceone/inventory/model/metric/database.py @@ -5,7 +5,7 @@ class Metric(MongoModel): metric_id = StringField(max_length=80, unique_with="domain_id") metric_job_id = StringField(max_length=40) - name = StringField(max_length=40) + name = StringField(max_length=80) status = StringField(max_length=20, choices=["IN_PROGRESS", "DONE"], default="DONE") metric_type = StringField(max_length=40, choices=["COUNTER", "GAUGE"]) resource_type = StringField()