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

datadog_dashboard_json marshal errors since 3.1.0 release #1166

Closed
tehlers320 opened this issue Aug 4, 2021 · 3 comments · Fixed by #1167
Closed

datadog_dashboard_json marshal errors since 3.1.0 release #1166

tehlers320 opened this issue Aug 4, 2021 · 3 comments · Fixed by #1167

Comments

@tehlers320
Copy link

Expected Behavior

What should have happened?
working

Actual Behavior

What actually happened?
broken

Error: json: cannot unmarshal number 1.083333333333333 into Go struct field .widgets of type int64

Steps to Reproduce

create a free layout board. Modify one of your panels y axis and export it.

    {
      "definition": {
        "autoscale": true,
        "precision": 0,
        "requests": [
          {
            "aggregator": "max",
            "q": "sum:system.mem.total{kube_cluster_name:*,$segment,$cluster,$region}"
          }
        ],
        "title": "Total memory",
        "title_align": "left",
        "title_size": "16",
        "type": "query_value"
      },
      "id": 3364849957681014,
      "layout": {
        "height": 15,
        "width": 15,
        "x": 31.66666666666667,
        "y": 1.083333333333333
      }
    },

with terraform

data "template_file" "dashboards" {
  for_each = local.dashboard_list
  template = file(each.key)
}

locals {
  dashboard_list = fileset(path.module, "files/dashboards/*.json")
  dashboard_list_json = { for k, v in data.template_file.dashboards : k => jsondecode(v.rendered) }
}

resource "datadog_dashboard_json" "dashboard_json" {
  for_each  = local.dashboard_list
  dashboard = data.template_file.dashboards[each.key].rendered
}

Important Factoids

this works in 3.0.0

The breakage began with
3.1.0

@therve
Copy link
Contributor

therve commented Aug 4, 2021

Hi,

Thanks for your report. Are you sure it's not happening with 3.0? I don't see any reason why it would happen starting 3.1.0. x/y are marked as int and always have been.

@tehlers320
Copy link
Author

Hi,

Thanks for your report. Are you sure it's not happening with 3.0? I don't see any reason why it would happen starting 3.1.0. x/y are marked as int and always have been.

Yup. I went back and forth to versions several times. I was looking around the versions too i don't see anything.

v3.0.0...v3.1.0

I'm not sure its involved but nothing here seems to scream a change.

DataDog/datadog-api-client-go@v1.0.0-beta.22...v1.0.0

@therve
Copy link
Contributor

therve commented Aug 5, 2021

You're right, we added a Get call that caused the deserialization issue. This will be fixed in the next release. Thanks.

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

Successfully merging a pull request may close this issue.

2 participants