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

google_monitoring_slo distribution_cut range values do not have to be integers #7614

Closed
mark-00 opened this issue Oct 23, 2020 · 3 comments · Fixed by GoogleCloudPlatform/magic-modules#4162, hashicorp/terraform-provider-google-beta#2655 or #7676
Assignees
Labels

Comments

@mark-00
Copy link

mark-00 commented Oct 23, 2020

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to the modular-magician user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to hashibot, a community member has claimed the issue already.

Terraform Version

terraform -v
Terraform v0.12.17

  • provider.google v3.36.0
  • provider.google-beta v3.36.0

Affected Resource(s)

google_monitoring_slo

Terraform Configuration Files

resource "google_monitoring_slo" "latency_95" {
  service             = google_monitoring_custom_service.customsrv.service_id
  windows_based_sli {
    good_total_ratio_threshold {
      threshold = 0.98
      performance {
        distribution_cut {
          distribution_filter = "metric.type=\"serviceruntime.googleapis.com/api/request_latencies\" resource.type=\"api\"  "
          range {
            max = 0.5
          }
        }
      }
    }
  }
}

Debug Output

Error: windows_based_sli.0.good_total_ratio_threshold.0.performance.0.distribution_cut.0.range.0.max: must be a whole number, got 0.5

Expected Behavior

0.5 should be accepted as value
It is accepted in console.google.com

Actual Behavior

0.5 is not accepted as value

Steps to Reproduce

  1. terraform apply

Important Factoids

References

https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services.serviceLevelObjectives#Range
say it must be a number this does not mean integer
cfr goal in https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services.serviceLevelObjectives#resource:-servicelevelobjective

  • #0000
@ghost ghost added the bug label Oct 23, 2020
@venkykuberan venkykuberan self-assigned this Oct 23, 2020
@venkykuberan
Copy link
Contributor

@mark-00 range value is in milliseconds, console may be rounding off to the closest ms. However i do see a problem with having Int type for range values in the schema. When the rangetype is Greater Than or Less Than API is sending back Infinity string in the response which breaks the TF import. We will work on it, thanks for filing the issue.

"performance": {
         "distributionCut": {
           "distributionFilter": "metric.type=\"actions.googleapis.com/smarthome_action/request_latencies\" resource.type=\"assistant_action_project\"",
           "range": {
             "min": "-Infinity",
             "max": 5
           }
         }
       } ```

@mark-00
Copy link
Author

mark-00 commented Oct 24, 2020

yes smarthome_action/request_latencies is in miliseconds so all you need is an integer

but api/request_latencies is in seconds and floats are needed to express the required slo

reference: https://cloud.google.com/monitoring/api/metrics_gcp

@ghost
Copy link

ghost commented Nov 29, 2020

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Nov 29, 2020
@github-actions github-actions bot added service/monitoring-services forward/review In review; remove label to forward labels Jan 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.