How do I define a dashboard as code?
A dashboard is described in a YAML file that lists each chart, its SQL query, and its layout position. The file lives in the repository, so the dashboard is created and updated from the same definition every time.
Command
bruin runDefined in
YAML + SQL
Works with
Bruin + your warehouse
What you get
declarative dashboard specSQL-backed chartsrepeatable builds
How it works in code
dashboard:
name: revenue_overview
charts:
- title: Daily revenue
type: line
query: |
SELECT order_date, SUM(amount) AS revenue
FROM analytics.orders
GROUP BY order_date
ORDER BY order_dateRun bruin run and the dashboard is built from the YAML definition.
Related use cases
Dashboards as code
Build a metrics layer so metrics stay consistent
How do I build a metrics layer so metrics stay consistent?
Dashboards as codeBuild dashboards directly from dbt models
How do I build dashboards directly from dbt models?
Dashboards as codeKeep BI metrics consistent across tools
How do I keep BI metrics consistent across tools?
Dashboards that live in git
Open source. Write YAML, run one command, query your warehouse directly.