Slide 1 of 3

The Foundation SDK builder pattern

How builders work in the Foundation SDK

You already know the Foundation SDK produces dashboard JSON. The usual way to get there is the builder pattern: define the dashboard one step at a time with chained method calls, instead of one giant config object.

Diagram showing builder pattern composition: DashboardBuilder chains to PanelBuilder via WithPanel, which chains to DataqueryBuilder via WithTarget

Follow the builder sequence

Most dashboard code follows this flow:

  • Start with DashboardBuilder for dashboard-level settings such as title, UID, refresh interval, and time range.
  • Add each panel with PanelBuilder (for example a time series or stat panel).
  • Add panel queries with DataqueryBuilder so each panel knows how to fetch data.
  • Call build() (or the equivalent in your language) and export the final dashboard JSON.

That JSON is what you will store in Git for Git Sync.

Why this matters

BenefitWhat it means for you
ComposableBuild complex dashboards from simple, reusable pieces
ReadableChained calls read like a description of what you want
IDE-friendlyAutocomplete shows valid options at every step