-
Notifications
You must be signed in to change notification settings - Fork 129
Open
Labels
Description
Currently DatadogDashboard.spec.widgets accepts a JSON string. However, after only a few widgets this becomes cumbersome and hard to maintain, both from a readability standpoint and a validation standpoint. JSON strings cannot natively be linted or validated with standard Kubernetes tooling. Instead, widgets should accept yaml which then in the controller, is converted to json.
Before:
widgets: |
[
{
"definition": {
"title": "Pod Count",
"type": "query_value",
"requests": [
{
"response_format": "scalar",
"queries": [
{
"data_source": "metrics",
"name": "query1",
"query": "sum:kubernetes.pods.running{cluster_name:example-cluster,service:$app.value,env:$env.value}",
"aggregator": "last"
}
]
}
],
"precision": 0
},
"layout": {"x": 0, "y": 0, "width": 2, "height": 2}
}
]After:
widgets:
- definition:
title: Pod Count
type: query_value
requests:
- response_format: scalar
queries:
- data_source: metrics
name: query1
query: sum:kubernetes.pods.running{cluster_name:example-cluster,service:$app.value,env:$env.value}
aggregator: last
precision: 0
layout:
x: 0
y: 0
width: 2
height: 2