https://pulumi.com logo
Title
f

full-pencil-66049

11/04/2022, 1:56 PM
Hi everyone! I'm trying to create a
DashboardJson
from an exported JSON from Datadog itself, but I'm having trouble with the definition of
query_values
. 🧵
For instance, datadog seems to define query values with the following format
{
  "id": 1234567890,
  "definition": {
    "title": "Title",
    "title_size": "16",
    "title_align": "left",
    "type": "query_value",
    "requests": [
      {
        "formulas": [
          {
            "formula": "query1"
          }
        ],
        "response_format": "scalar",
        "queries": [
          {
            "query": "some_query",
            "data_source": "metrics",
            "name": "query1",
            "aggregator": "sum"
          }
        ]
      }
    ],
    "autoscale": true,
    "precision": 0
  },
  "layout": {
    "x": 0,
    "y": 0,
    "width": 0,
    "height": 0
  }
}
but when I run
pulumi up
I get the following error
error creating resource from <https://api.datadoghq.com/api/v1/dashboard>: 400 Bad Request: {"errors":["Invalid widget definition at position 0 of type group. Error: Invalid inner widget definition at position 0 of type query_value. Error: {u'formulas': [{u'formula': u'query1'}], u'queries': [{u'query': u'some_query', u'data_source': u'metrics', u'name': u'query1', u'aggregator': u'sum'}]} is not valid under any of the given schemas.> - invalid_inner_widget=<{\"definition\": {\"requests\": [{\"formulas\": [{\"formula\": \"query1\"}], \"queries\": [{\"query\": \"some_query\", \"data_source\": \"metrics\", \"name\": \"query1\", \"aggregator\": \"sum\"}]}], \"type\": \"query_value\", \"title\": \"Job started\"}, \"layout\": {\"y\": 0, \"x\": 0, \"is_column_break\": false, \"height\": 0, \"width\": 0}}."]}
I don't understand what I'm doing wrong since this seems to be the correct JSON schema Does anyone have any idea how to solve this?
(moved wall of text into thread to avoid flooding screens)