Coder Social home page Coder Social logo

Comments (4)

masci avatar masci commented on June 30, 2024 1

@tmack8001 correct, the label is expected to be a string here https://github.com/zorkian/go-datadog-api/blob/master/dashboards.go#L44 but this is the case only when the checkmark on the UI is set AND the input type contains some text, otherwise the API returns true, meaning the label is set but it contains the marker definition value (which is whatever is in the value JSON field).

The correct behaviour IMO would be having another, boolean JSON field in the response representing whether the label checkmark was set or not and always return a string for label but this is something that needs to be addressed on the Datadog side, in the meantime I can't think about any workaround other than leaving a note on the docs.

from terraform-provider-datadog.

tmack8001 avatar tmack8001 commented on June 30, 2024

I'm also seeing similar when not specifying label values in the Datadog UI which then breaks our CI/CD pipelines for terraform changes.

* module.main-timeboard.datadog_timeboard.main-dashboard: datadog_timeboard.main-dashboard: json: cannot unmarshal bool into Go struct field GraphDefinitionMarker.label of type string

here is the example marker block as defined in the Datadog API for the graph that breaks terraform builds:

"markers": [
    {
      "val": "250000000",
      "value": "y = 250000000",
      "type": "error dashed",
      "label": true
    },
    {
      "val": "200000000",
      "value": "y = 200000000",
      "type": "warning dashed",
      "label": true
    }
  ]

This "label: true" is the syntax for when a string isn't provided in the "label" field in the UI / API. I'm guessing the go http library used by this provider is expecting this to always be a string and sometimes (when no text label is provided) breaks unmarshalling with the expected struct.

from terraform-provider-datadog.

masci avatar masci commented on June 30, 2024

@robinbowes setting dim, min and max explicitly is not actually needed, to set a range between 0.8 and 1.0 on y, all you have to do is the following

    marker {
      label = "High Latency"
      type  = "error solid"
      value = "0.8 > y > 0"
    }

from terraform-provider-datadog.

masci avatar masci commented on June 30, 2024

Closing this as the first issue seems invalid and the second one was fixed adding a note to the docs (literally the only thing I can do at this moment).

from terraform-provider-datadog.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.