Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing test(s): TestAccMonitoringMetricDescriptor_update (permadiff) #12139

Closed
melinath opened this issue Jul 20, 2022 · 10 comments
Closed

Failing test(s): TestAccMonitoringMetricDescriptor_update (permadiff) #12139

melinath opened this issue Jul 20, 2022 · 10 comments

Comments

@melinath
Copy link
Collaborator

melinath commented Jul 20, 2022

Affected Resource(s)

  • google_monitoring_metric_descriptor

Failure rate: 100% since 7/15/2022

Impacted tests:

  • TestAccMonitoringMetricDescriptor_update

Nightly builds:

Message:

# google_monitoring_metric_descriptor.basic will be updated in-place
~ resource "google_monitoring_metric_descriptor" "basic" {
id                       = "projects/project-id/metricDescriptors/custom.googleapis.com/stores/daily_sales"
name                     = "projects/project-id/metricDescriptors/custom.googleapis.com/stores/daily_sales"
# (9 unchanged attributes hidden)
- labels {
- description = "description1" -> null
- key         = "key1" -> null
- value_type  = "STRING" -> null
}
@melinath
Copy link
Collaborator Author

This is a real permadiff but it's not a breaking change since the labels field isn't ForceNew. I don't see any changes in the provider that would've caused this so it's probably an api-side change.

Specifically, it looks like the API is not properly updating the labels to remove the old label:

---[ REQUEST ]---------------------------------------
POST /v3/projects/project-id/metricDescriptors?alt=json HTTP/1.1
Host: monitoring.googleapis.com
User-Agent: Terraform/1.2.5 (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google/dev
Content-Length: 347
Content-Type: application/json
Accept-Encoding: gzip

{
 "description": "Daily sales records from all branch stores.",
 "displayName": "daily sales",
 "labels": [
  {
   "description": "description2",
   "key": "key2",
   "valueType": "INT64"
  }
 ],
 "launchStage": "BETA",
 "metadata": {
  "ingestDelay": "60s",
  "samplePeriod": "60s"
 },
 "metricKind": "GAUGE",
 "type": "custom.googleapis.com/stores/daily_sales",
 "unit": "{USD}",
 "valueType": "DOUBLE"
}

-----------------------------------------------------
2022/07/20 14:15:11 [DEBUG] Google API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/2.0 200 OK
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Date: Wed, 20 Jul 2022 14:15:11 GMT
Server: ESF
Vary: Origin
Vary: X-Origin
Vary: Referer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0

{
  "name": "projects/project-id/metricDescriptors/custom.googleapis.com/stores/daily_sales",
  "labels": [
    {
      "key": "key2",
      "valueType": "INT64",
      "description": "description2"
    },
    {
      "key": "key1",
      "description": "description1"
    }
  ],
  "metricKind": "GAUGE",
  "valueType": "DOUBLE",
  "unit": "{USD}",
  "description": "Daily sales records from all branch stores.",
  "displayName": "daily sales",
  "type": "custom.googleapis.com/stores/daily_sales",
  "metadata": {
    "samplePeriod": "60s",
    "ingestDelay": "60s"
  },
  "launchStage": "BETA"
}

@melinath
Copy link
Collaborator Author

melinath commented Jul 22, 2022

Oddly, this api doesn't actually seem to officially support updates at all - only create & delete. So it's odd that we're a) allowing update, and b) treating the update as an update https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors/create

@melinath
Copy link
Collaborator Author

b/239950166

@rileykarson rileykarson added this to the Near-Term Goals milestone Jul 25, 2022
@melinath
Copy link
Collaborator Author

b/239950421

@AarshDhokai
Copy link
Contributor

@AarshDhokai

This comment was marked as outdated.

@melinath
Copy link
Collaborator Author

The permadiff for this test has gotten longer.

@melinath
Copy link
Collaborator Author

melinath commented Aug 7, 2023

The change here is that the labels field should either be ForceNew or output-only - see b/ tickets for more details.

@c2thorn
Copy link
Collaborator

c2thorn commented Sep 26, 2023

closed with GoogleCloudPlatform/magic-modules#8914

@c2thorn c2thorn closed this as completed Sep 26, 2023
@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants