Add Google Cloud IAM integration metrics to Service Ping
What does this MR do and why?
Add Google Cloud IAM integration metrics to Service Ping
Many metrics exist for integrations, but right now we are not tracking them for Google Cloud IAM integration because we lack the metric definition files for them. This adds definition files for some of the GCP IAM integration metrics, to help us track the success of this feature.
This MR is modeled directly off of !148414 (merged)
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
How to set up and validate locally
Execute the following commands in the rails console, while emultating SaaS:
GITLAB_SIMULATE_SAAS=1 bin/rails console
-
Verify the integration Google Artifact Registry
google_cloud_platform_workload_identity_federation
is listed among the available integrationsIntegration.available_integration_names(include_dev: false, include_disabled: true)
-
Verify that the metric returns
0
spr = Gitlab::Usage::ServicePingReport.for(output: :all_metrics_values, cached: false) ; spr['counts']['projects_google_cloud_platform_workload_identity_federation_active']
The counter should return
0
-
Create a new Google Artifact Registry integration
FactoryBot.create(:google_cloud_platform_artifact_registry_integration)
-
Verify that the metric is updated
Gitlab::Usage::ServicePingReport.for(output: :all_metrics_values, cached: false)['counts']['projects_google_cloud_platform_workload_identity_federation_active']
The counter should return
1
-
Check the same for the
group_
count:spr['counts']['groups_google_cloud_platform_workload_identity_federation_active'] # should eq 0 group = Group.last FactoryBot.create(:google_cloud_platform_artifact_registry_integration, project: nil, group: group) spr = Gitlab::Usage::ServicePingReport.for(output: :all_metrics_values, cached: false) spr['counts']['groups_google_cloud_platform_workload_identity_federation_active']
Related to #456104 (closed)