Skip to content

apm_issue_stream queries do not support state filtering #3300

@peteyus

Description

@peteyus

Datadog Terraform Provider Version

3.75.0

Terraform Version

1.10.5

What resources or data sources are affected?

resource_datadog_dashboard

Terraform Configuration Files

# Note: simplified from my dashboard, so line number in error doesn't line up.
resource "datadog_dashboard" "dashboard" {
  title       = var.project_name
  description = var.project_description
  layout_type = "ordered"
  tags        = ["team:${var.team_name}"]
  template_variable {
    name             = "env"
    prefix           = "env"
    available_values = ["nonprod", "prod"]
    defaults         = ["prod"]
  }
  template_variable {
    name             = "service"
    prefix           = "service"
    available_values = [var.service_name]
    defaults         = [var.service_name]
  }
      widget {
        list_stream_definition {
          title       = "Active & Unresolved Issues"
          title_size  = "16"
          title_align = "left"
          request {
            response_format = "event_list"
            query {
              data_source  = "apm_issue_stream"
              query_string = "$env $service"
              indexes      = []
              # states       = ["OPEN", "ACKNOWLEDGED"] TODO - Not supported?
            }
            columns {
              field = "details"
              width = "auto"
            }
            columns {
              field = "count"
              width = "auto"
            }
            columns {
              field = "volume"
              width = "auto"
            }
          }
        }
      }
}

Relevant debug or panic output

Running Terraform plan...

│ Error: Unsupported argument

│ on ../../../dd-module/dashboard.tf line 169, in resource "datadog_dashboard" "dashboard":
│ 169: states = ["OPEN", "ACKNOWLEDGED"]

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

Expected Behavior

I should be able to filter the issues list much as I can with a JSON/API request.

Actual Behavior

Error message that "states" is unexpected in a query object on a list_stream_definition request. I'm unable to find anything in the documentation about how to do the filtering in the query string, which would be an acceptable alternative.

Steps to Reproduce

Create a list view widget querying from apm_issue_stream. state filtering is unavailable (and undocumented).

Important Factoids

From the UI, you can create one and filter it and states is in the JSON at the same level as the query string.

{
    "title": "Active & Unresolved Issues",
    "requests": [
        {
            "response_format": "event_list",
            "query": {
                "data_source": "issue_stream",
                "query_string": "$env $service",
                "indexes": [],
                "states": [
                    "OPEN",
                    "ACKNOWLEDGED"
                ]
            },
            "columns": [
                {
                    "field": "details",
                    "width": "auto"
                },
                {
                    "field": "count",
                    "width": "auto"
                },
                {
                    "field": "volume",
                    "width": "auto"
                },
                {
                    "field": "state",
                    "width": "auto"
                }
            ]
        }
    ],
    "type": "list_stream"
}

References

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions