Related to issue #2423
Problem
Even when the DatadogDashboard is able to use native yaml syntax instead of JSON string, a DatadogDashboard resource can balloon to hundreds or thousands of lines. This makes is hard to maintain.
Proposal
I propose a new CRD called DatadogWidget. This resource would look like the following:
apiVersion: datadoghq.com/v1alpha1
kind: DatadogWidget
metadata:
name: example-widget
namespace: monitoring
spec:
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
This resource would define 1 (and only one widget). Then this widget could be referenced in the DatadogDashboard resource.
widgetsRef:
- name: example-widget
namespace: monitoring
layout:
x: 0
y: 0
width: 2
height: 2
This approach also allows widgets to be reusable across different dashboards. Users would still be able to use widgets together with widgetsRef
Related to issue #2423
Problem
Even when the DatadogDashboard is able to use native yaml syntax instead of JSON string, a DatadogDashboard resource can balloon to hundreds or thousands of lines. This makes is hard to maintain.
Proposal
I propose a new CRD called
DatadogWidget. This resource would look like the following:This resource would define 1 (and only one widget). Then this widget could be referenced in the DatadogDashboard resource.
This approach also allows widgets to be reusable across different dashboards. Users would still be able to use
widgetstogether withwidgetsRef