Skip to content

Feature Request: New CRD for DatadogWidget #2425

@starlightromero

Description

@starlightromero

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions