Skip to content

Make count column available for list_stream_definition #2915

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

Open
camillds opened this issue Mar 17, 2025 · 2 comments
Open

Make count column available for list_stream_definition #2915

camillds opened this issue Mar 17, 2025 · 2 comments

Comments

@camillds
Copy link

camillds commented Mar 17, 2025

What resources or data sources are affected?

From the current documentation I cannot figure out how to configure the count column for the logs pattern widget. With the following configuration it is empty:

terraform {
  required_version = ">= 1.0.0"
  required_providers {
    datadog = {
      source  = "DataDog/datadog"
      version = "~> 3.53.0"
    }
  }
}
resource "datadog_dashboard" "issue_2915" {
  title       = "issue_2915"
  description = "issue_2915"
  layout_type = "ordered"

  widget {
    list_stream_definition {
      request {
        response_format = "event_list"
        columns {
          field = "count"
          width = "auto"
        }
        columns {
          field = "volume"
          width = "auto"
        }
        columns {
          field = "service"
          width = "auto"
        }
        columns {
          field = "Message"
          width = "auto"
        }
        query {
          data_source = "logs_pattern_stream"
          query_string = "status:(error OR critical) service:$service.value env:$env.value"
        }
      }
      title = "Most Common Errors"
    }
  }
}

Feature Request

No response

References

No response

@Supam
Copy link
Member

Supam commented Mar 19, 2025

Hi there @camillds !

Thank you for bringing this up. This field is indeed a bit confusing to configure.
While we work to document this better you can replace the count field with matches.

The following widget configuration should create a non-empty column named "Count":

widget {
    list_stream_definition {
      request {
        response_format = "event_list"
        columns {
          field = "matches"
          width = "auto"
        }
        columns {
          field = "volume"
          width = "auto"
        }
        columns {
          field = "service"
          width = "auto"
        }
        columns {
          field = "Message"
          width = "auto"
        }
        query {
          data_source = "logs_pattern_stream"
          query_string = "status:(error OR critical) service:$service.value env:$env.value"
        }
      }
      title = "Most Common Errors"
    }
  }

@camillds
Copy link
Author

Thanks, looks good! I have the general feeling that the nested types docs are a bit confusing and hard to navigate. Instead, some more examples like the above would be very helpful. Feel free to close this issue

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

No branches or pull requests

2 participants