coralogix / terraform-provider-coralogix

Terraform provider for Coralogix
https://registry.terraform.io/providers/coralogix/coralogix
Apache License 2.0
10 stars 8 forks source link

Error "group_by cannot be empty" with bar_chart #250

Open tifennlegoff opened 1 month ago

tifennlegoff commented 1 month ago

Hey, when we add a bar_chart graph with X AXIS at Value, we have an empty graph with group_by cannot be empty. I tried to modify graph, set X AXIS at Time and back to Value, then the graph works with Group By filled at partition. I saved and export as Json to see what is the missing setting and I seen it was metrics.groupNames: partition. I added the setting group_names = ["partition"] under bar_chart.query.metrics and bar_chart.query.metrics.promql_query but I still have the same issue.

Affected Resource(s)

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

          {
            height = 35
            widgets = [
              {
            title       = "Consumer lag partition"
            description = "Kafka consumer lag (by partition)"
            definition = {
              bar_chart = {
                sort_by = "value"
                query = {
                  metrics = {
                    promql_query = <<EOT
sum by (partition) (
  kafka_consumergroup_lag{
    consumergroup="xxx",
    topic="xxx",
    kubernetes_namespace="xxx"
  }
)
                        EOT
                      group_names = ["partition"]
                  }
                }
                xaxis = {
                  value = {}
                }
              }
            }
              }
            ]
          }

Debug Output

Panic Output

Expected Behavior

Actual Behavior

The graph is empty with group_by cannot be empty error

Steps to Reproduce

  1. Add a bar_chart graph on dashboard with prom query and X AXIS at Value

Important Factoids

References

Community Note

tifennlegoff commented 1 month ago

I'm not sure but I don't see group_byin bar_chart https://github.com/coralogix/terraform-provider-coralogix/blob/master/coralogix/resource_coralogix_dashboard.go#L1897

iagobanov commented 3 days ago

CX team got eyes on this one. I'll keep you posted as soon as possible

tifennlegoff commented 1 day ago

Thanks @iagobanov