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

Dashboard event_query doesn't support ci_pipelines datasource #1745

Closed
emmaLP opened this issue Jan 30, 2023 · 1 comment
Closed

Dashboard event_query doesn't support ci_pipelines datasource #1745

emmaLP opened this issue Jan 30, 2023 · 1 comment

Comments

@emmaLP
Copy link

emmaLP commented Jan 30, 2023

Ability to graph with terraform where the datasource is ci_pipelines

Terraform Version

Terraform v1.3.7
on darwin_amd64

  • provider registry.terraform.io/datadog/datadog v3.20.0
  • provider registry.terraform.io/hashicorp/aws v4.45.0

Affected Resource(s)

Please list the resources as a list, for example:

  • datadog_dashboard

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

Terraform Configuration Files

locals {
    repositories = ["test", "test2"]
}
resource "datadog_dashboard" "engineering_metrics" {
  count = (var.environment == "production" ? 1 : 0)

  title       = "WIP - Platform Customer - Engineering Metrics"
  description = "Dashboard to help track deployments the platform-customer team make based on deployment pipelines and only the repos that customer own.\n\n  Eventually this dashboard will include additional metrics as time goes on bur for now is only tracking deployments"
  layout_type = "ordered"
  reflow_type = "auto"
  template_variable {
    name             = "repositories"
    available_values = local.repositories
    default          = join(",",local.repositories)
  }
  widget {
    timeseries_definition {
      title         = "Deployments Per Day"
      title_align   = "left"
      show_legend   = true
      legend_layout = "auto"
      legend_columns = [
        "avg",
        "min",
        "max",
        "value",
        "sum"
      ]
      request {
        formula {
          formula_expression = "default_zero(query1)"
          alias              = "Production"
        }
        style {
          palette    = "dog_classic"
          line_type  = "solid"
          line_width = "normal"
        }
        display_type = "bars"
        query {
          event_query {
            data_source = "ci_pipelines"
            name        = "prod_per_day"
            search {
              query = "ci_level:pipeline -@ci.pipeline.id:*_ApproveDeployment @git.repository.name:($repositories.value OR $repositories) @trigger:production @ci.status:success"
            }
            indexes = ["*"]
            compute {
              aggregation = "count"
              interval    = 86400000
            }
          }
        }
      }
      request {
        formula {
          alias              = "Cumulative Total"
          formula_expression = "cumsum(query)"
        }
        style {
          palette    = "green"
          line_type  = "dashed"
          line_width = "normal"
        }
        display_type = "line"
        query {
          event_query {
            data_source = "ci_pipelines"
            name        = "query"
            search {
              query = "ci_level:pipeline -@ci.pipeline.id:*_ApproveDeployment @git.repository.name:($repositories.value OR $repositories) @trigger:production @ci.status:success"
            }
            indexes = ["*"]
            compute {
              aggregation = "count"
              interval    = 86400000
            }
          }
        }
      }
    }
  }
}

Output

image

Expected Behavior

Ability to have event queries that look at the ci_pipelines datasource like the UI supports

Actual Behavior

Error as per image in output

Steps to Reproduce

  1. terraform apply

Important Factoids

N/A

References

@skarimo
Copy link
Member

skarimo commented Mar 2, 2023

Thanks for the report. This is closed by DataDog/datadog-api-client-go#1894

@skarimo skarimo closed this as completed Mar 2, 2023
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

2 participants