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

Add Missing scaling Attribute to toplist_definition.style in Datadog Terraform Provider #2775

Open
dariel-mizrachi opened this issue Jan 16, 2025 · 0 comments
Labels

Comments

@dariel-mizrachi
Copy link

Datadog Terraform Provider Version

v3.52.0

Terraform Version

v1.7.5

What resources or data sources are affected?

I would like to report that the toplist_definition.style in the Datadog provider for Terraform is missing the scaling attribute, which is available in the Datadog UI.

Terraform Configuration Files

resource "datadog_dashboard" "lab_session_percentage" {
  title       = "Title"
  description = ""
  layout_type = "ordered"
  reflow_type = "auto"


  dynamic "widget" {
    for_each = local.actions
    content {
      group_definition {
        layout_type      = "ordered"
        title            = upper(replace(widget.key, "_", " "))
        background_color = local.colors[widget.key]

        widget {
          toplist_definition {
            title = "Session Percentage with ${replace(widget.key, "_", " ")} by Store"
            style {
              display {
                type = "flat"
              }
              scaling = "relative"
            }

            request {
              formula {
                formula_expression = "default_zero(best_store_query)"
              }
              query {
                event_query {

                  data_source = "rum"
                  name        = "best_store_query"
                  storage     = "hot"
                  indexes     = ["*"]
                  search {

                    query = "@type:action ${widget.value} @context.storeId:(${join(" OR ", local.reformatted_stores)})"
                  }
                  compute {
                    
                    aggregation = "cardinality"
                    metric      = "@session.id"
                  }
                  group_by {
                    facet = "@context.storeId"
                    limit = 1000


                    sort {
                      aggregation = "cardinality"
                      metric      = "@session.id"
                      order       = "desc"

                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

Relevant debug or panic output

│ Error: Unsupported argument

│ on lab-session-percentage-dashboard.tf line 167, in resource "datadog_dashboard" "lab_session_percentage":
│ 167: scaling = "relative"

│ An argument named "scaling" is not expected here.

Expected Behavior

The scaling attribute should be available to allow for relative scaling of values in the toplist widget, similar to how it is implemented in the Datadog UI.

Actual Behavior

The actual behavior is that the toplist_definition.style in the Datadog Terraform provider does not include the scaling attribute, preventing users from applying relative scaling to values displayed in toplist widgets, which is available in the Datadog UI.

Steps to Reproduce

terraform apply

Important Factoids

No response

References

Datadog Top List Widget Documentation
Terraform Datadog Dashboard Resource Documentation

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

No branches or pull requests

1 participant