GoogleCloudPlatform / cloud-ops-sandbox

Cloud Operations Sandbox is an open source collection of tools that helps practitioners to learn O11y and R9y practices from Google and apply them using Cloud Operations suite of tools.
Apache License 2.0
406 stars 148 forks source link

Error creating Slo: googleapi: Error 400: Invalid SLO definition: The metric referenced by the provided filter is unknown. Check the metric name and labels. #896

Closed palladius closed 2 years ago

palladius commented 2 years ago

Terraform gives me this error, although the final command says its deployed succesfully:

google_monitoring_alert_policy.alert_policy: Creation complete after 3s [id=projects/cloud-ops-sandbox-455155008/alertPolicies/17625491243954939044]
google_monitoring_alert_policy.custom_service_availability_slo_alert[1]: Creating...
google_monitoring_alert_policy.custom_service_latency_slo_alert[4]: Creation complete after 4s [id=projects/cloud-ops-sandbox-455155008/alertPolicies/17625491243954940868]
google_monitoring_alert_policy.custom_service_latency_slo_alert[0]: Creation complete after 4s [id=projects/cloud-ops-sandbox-455155008/alertPolicies/228983056492115845]
google_monitoring_alert_policy.custom_service_latency_slo_alert[3]: Creation complete after 5s [id=projects/cloud-ops-sandbox-455155008/alertPolicies/6450665869418081994]
google_monitoring_alert_policy.custom_service_latency_slo_alert[1]: Creation complete after 4s [id=projects/cloud-ops-sandbox-455155008/alertPolicies/6450665869418079535]
google_monitoring_alert_policy.custom_service_latency_slo_alert[2]: Creation complete after 9s [id=projects/cloud-ops-sandbox-455155008/alertPolicies/8548508559398136430]
google_monitoring_alert_policy.custom_service_availability_slo_alert[0]: Creation complete after 8s [id=projects/cloud-ops-sandbox-455155008/alertPolicies/3052612361716686830]
google_monitoring_alert_policy.custom_service_availability_slo_alert[4]: Creation complete after 9s [id=projects/cloud-ops-sandbox-455155008/alertPolicies/10837047908266122927]
google_monitoring_alert_policy.custom_service_availability_slo_alert[3]: Creation complete after 8s [id=projects/cloud-ops-sandbox-455155008/alertPolicies/6185104747852603124]
google_monitoring_alert_policy.custom_service_availability_slo_alert[2]: Creation complete after 9s [id=projects/cloud-ops-sandbox-455155008/alertPolicies/10837047908266121726]
google_monitoring_alert_policy.custom_service_availability_slo_alert[1]: Creation complete after 9s [id=projects/cloud-ops-sandbox-455155008/alertPolicies/17625491243954938877]
╷
│ Error: Error creating Slo: googleapi: Error 400: Invalid SLO definition: The metric referenced by the provided filter is unknown. Check the metric name and labels.
│
│   with google_monitoring_slo.rating_service_freshness_slo,
│   on 04_slos.tf line 257, in resource "google_monitoring_slo" "rating_service_freshness_slo":
│  257: resource "google_monitoring_slo" "rating_service_freshness_slo" {
│
[...]
Cloud Operations Sandbox deployed successfully!
palladius commented 2 years ago

Note that after a second invokation I just get a bunch of

│ Error: Error creating Service: googleapi: Error 409: Requested entity already exists
│ Error creating Metric: googleapi: Error 409: Metric XXX already exists.
│ Error: Error creating Slo: googleapi: Error 409: Requested entity already exists

which is good so we can have this as a P3

-- ricc@

daniel-sanche commented 2 years ago

This should be resolved in https://github.com/GoogleCloudPlatform/cloud-ops-sandbox/pull/931