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

Resource newrelic_one_dashboard: Unable to add float thresholds to widget_line #2703

Closed
juwatanabe opened this issue Jun 27, 2024 · 2 comments

Comments

@juwatanabe
Copy link

juwatanabe commented Jun 27, 2024

Terraform Version

Terraform v1.7.5

  • provider registry.terraform.io/newrelic/newrelic v3.38.1

Affected Resource(s)

Please list the resources as a list, for example:

  • resource_newrelic_one_dashboard

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Actual Behavior

When trying to create a resource_newrelic_one_dashboard with a widget_line threshold with non integer type the provider is erroring. See below terraform to create widget_line

   widget_line {
      title  = "Node Request/Capacity"
      nrql_query {
        query = "SELECT latest(cpuRequestedCores)/max(capacityCpuCores) as cpuRequestPercent, latest(memoryRequestedBytes)/max(capacityMemoryBytes) as memRequestPercent FROM K8sNodeSample WHERE clusterName = {{cluster}} and `label.node-pool` in ({{node_pool}}) FACET aparse(hostname, '*.%') TIMESERIES 1 minute"
      }
      units {
        unit = "percentage"
      }
      is_label_visible = true
      threshold {
        name     = "Request Warn"
        from     = 0.9
        to       = 0.95
        severity = "warning"
      }
    }

When trying to apply I get the below errors:

│ Error: Attribute must be a whole number, got 0.9
│
│   with module.standard-deploy.module.by-cluster.newrelic_one_dashboard.filter_by_cluster,
│   on newrelic/modules/dashboards/by-cluster/main.tf line 240, in resource "newrelic_one_dashboard" "filter_by_cluster":
│  240:         severity = "warning"
│
│ Error: Attribute must be a whole number, got 0.95
│
│   with module.standard-deploy.module.by-cluster.newrelic_one_dashboard.filter_by_cluster,
│   on newrelic/modules/dashboards/by-cluster/main.tf line 240, in resource "newrelic_one_dashboard" "filter_by_cluster":
│  240:         severity = "warning"

Expected Behavior

Resource should be created successfully

Steps to Reproduce

  1. terraform apply

Important Factoids

From looking at the code for dashboardWidgetLineSchemaElem() I believe the type just needs to be adjusted from Int to Float.

@juwatanabe juwatanabe changed the title Unable to add float thresholds to Unable to add float thresholds to resource_newrelic_one_dashboard widget_line Jun 27, 2024
@pranav-new-relic
Copy link
Member

@juwatanabe thanks for reporting this - this issue is already on our radar via other internal feedback we've received. We shall be prioritizing this based on our current task queue.

@pranav-new-relic pranav-new-relic changed the title Unable to add float thresholds to resource_newrelic_one_dashboard widget_line Resource newrelic_one_dashboard: Unable to add float thresholds to widget_line Jul 1, 2024
vagrawal-newrelic added a commit that referenced this issue Jul 11, 2024
…m' feilds data type from int to float

Updated the data type for the "to" and "From" feilds in "Threashold" in line and table widget from int to float(GitHub #2703)
@vagrawal-newrelic
Copy link
Contributor

Please note that this feature is implemented and released. Now you can use float values also in threshold to and from fields in line and also table wizard in new relic dashboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants