Skip to content

feat(dashboard): add DatadogDashboard v1alpha2 CRD with native YAML widgets#2430

Open
starlightromero wants to merge 1 commit intoDataDog:mainfrom
starlightromero:feat/datadogdashboard-v1alpha2-yaml-widgets
Open

feat(dashboard): add DatadogDashboard v1alpha2 CRD with native YAML widgets#2430
starlightromero wants to merge 1 commit intoDataDog:mainfrom
starlightromero:feat/datadogdashboard-v1alpha2-yaml-widgets

Conversation

@starlightromero
Copy link
Copy Markdown

Summary

Implements DatadogDashboard v1alpha2 CRD with native YAML widgets, replacing JSON string format with structured YAML arrays for improved developer experience.

Changes

  • New v1alpha2 API: Added DashboardWidget and WidgetLayout structs with native YAML support
  • Enhanced Validation: Comprehensive validation with detailed error messages for all widget types
  • Version-aware Controller: Updated controller to handle both v1alpha1 and v1alpha2 seamlessly
  • Backward Compatibility: Existing v1alpha1 dashboards continue to work unchanged
  • Comprehensive Testing: 51+ test cases including property-based tests for correctness
  • Updated Documentation: Migration guide and examples showing YAML array benefits
  • CRD Generation: Proper OpenAPI v3 schema with v1alpha2 as storage version

Benefits

  • 🎯 Native YAML syntax - No more JSON strings, pure Kubernetes YAML
  • 🔧 Better IDE support - Auto-completion and validation in editors
  • 🛡️ Type safety - Compile-time validation of widget structure
  • 📚 Enhanced DX - Cleaner, more readable dashboard definitions

Testing

  • All existing tests pass (100% backward compatibility)
  • 8 property-based tests validate correctness properties
  • Integration tests ensure both API versions coexist
  • Comprehensive validation tests for all 27 widget types

Migration

Users can migrate from v1alpha1 to v1alpha2 by:

  1. Changing apiVersion to datadoghq.com/v1alpha2
  2. Converting JSON string widgets to YAML arrays
  3. Optionally adding layout information to widgets

Closes

Fixes #2423

Example

Before (v1alpha1):

spec:
  widgets: '[{"definition": {"type": "timeseries", "title": "CPU"}}]'

After (v1alpha2):

spec:
  widgets:
    - definition:
        type: timeseries
        title: CPU Usage
      layout:
        x: 0
        y: 0
        width: 4
        height: 2

@starlightromero starlightromero requested review from a team as code owners December 25, 2025 23:34
…idgets

- Add v1alpha2 API types with DashboardWidget and WidgetLayout structs
- Replace JSON string widgets with native YAML array syntax
- Implement comprehensive validation with detailed error messages
- Add version-aware widget processors for v1alpha1 and v1alpha2
- Update controller to handle both API versions seamlessly
- Generate CRDs with proper OpenAPI v3 schema validation
- Add comprehensive test coverage including property-based tests
- Update documentation and examples showing YAML array benefits

Closes: DataDog#2423
@starlightromero starlightromero force-pushed the feat/datadogdashboard-v1alpha2-yaml-widgets branch from 04ed956 to cfe427e Compare December 25, 2025 23:37
@starlightromero
Copy link
Copy Markdown
Author

@rtrieu Thanks for the approval. Any chance you can provide an ETA on when this can be merged in?

@rtrieu
Copy link
Copy Markdown
Contributor

rtrieu commented Jan 23, 2026

hi @starlightromero my approval was from an editorial perspective. this update as a whole will need to be reviewed and approved by a different team (Container Ecosystems) before merging.

@starlightromero
Copy link
Copy Markdown
Author

@rtrieu thank you providing insight into the process. What is the estimated timeline for review by the Container Ecosystems team?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DatadogDashboard] Support for yaml syntax for widgets

2 participants