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_logging_metric exponential_buckets growth_factor is limited to a whole number #5096

Closed
bkamin29 opened this issue Dec 6, 2019 · 2 comments · Fixed by GoogleCloudPlatform/magic-modules#2800
Assignees
Labels

Comments

@bkamin29
Copy link

bkamin29 commented Dec 6, 2019

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 v0.12.17

  • provider.aiven (unversioned)
  • provider.archive v1.3.0
  • provider.github v2.2.1
  • provider.google v2.20.0
  • provider.google-beta v3.0.0
  • provider.kubernetes v1.10.0
  • provider.local v1.4.0
  • provider.null v2.1.2
  • provider.random v2.2.1
  • provider.template v2.1.2

Affected Resource(s)

  • google_logging_metric

Terraform Configuration Files

resource "google_logging_metric" "latency_distribution" {
  provider        = google-beta
  name            = "nfs/latency"
  description     = "Metric based on logs provided by the K8S Ingress Controller. Used to compute latency SLO on NFS."
  filter          = "resource.type=\"k8s_container\"\nresource.labels.namespace_name=\"ingress-nginx\"\nresource.labels.container_name=\"nginx-ingress-controller\"\njsonPayload.requestUrl:(\"-fux.nfs\" AND \".decathlon.io\")\njsonPayload.requestMethod=\"GET\"\njsonPayload.status<300\njsonPayload.status>=200"
  value_extractor = "EXTRACT(jsonPayload.latency)"
  metric_descriptor {
    metric_kind = "DELTA"
    value_type  = "DISTRIBUTION"
    unit        = "s"
    labels {
      key         = "platform"
      value_type  = "STRING"
      description = "nfs environment"
    }
    labels {
      key         = "page_name"
      value_type  = "STRING"
      description = "page type"
    }
    labels {
      key         = "country"
      value_type  = "STRING"
      description = "country code"
    }
  }
  label_extractors = {
    "country"   = "REGEXP_EXTRACT(jsonPayload.requestUrl, \"^\\\\w\\\\w-(\\\\w\\\\w).*$\")",
    "page_name" = "REGEXP_EXTRACT(jsonPayload.requestUrl, \"decathlon\\\\.io(?:\\\\/\\\\w\\\\w)?(\\\\/.*?)[\\\\/\\\\?].*$\")",
    "platform"  = "REGEXP_EXTRACT(jsonPayload.requestUrl, \"^\\\\w\\\\w-\\\\w\\\\w-(\\\\w+)-.*$\")"
  }
  bucket_options {
    exponential_buckets {
      num_finite_buckets = 64
      growth_factor      = 1.414213562
      scale         = 0.001
    }
  }
}

Debug Output

Expected Behavior

When using exponential_buckets, floating point numbers should be supported for the attribute "growth_factor". At least in the Stackdriver UI I can enter a float.

Actual Behavior

Error: bucket_options.0.exponential_buckets.0.growth_factor: must be a whole number, got 1.414213562

  on ../slo-generator/logs-based-metrics.tf line 43, in resource "google_logging_metric" "latency_distribution":
  43: resource "google_logging_metric" "latency_distribution" {

Steps to Reproduce

  1. terraform plan

Important Factoids

authenticating as a user instead

References

  • #0000
@ghost ghost added the bug label Dec 6, 2019
@bkamin29
Copy link
Author

bkamin29 commented Dec 6, 2019

Workarround :

Update manualy the value growth_factor using Stackdriver UI and add in the Terraform ressource block :

lifecycle {
    ignore_changes = [bucket_options]
  }

@ghost
Copy link

ghost commented Mar 28, 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 and limited conversation to collaborators Mar 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants