Dashboards as Code/Dashboards as codeAnalytics Engineer

How do I build a metrics layer so metrics stay consistent?

A metric is defined once in YAML with its aggregation, source table, and time dimension. Every chart and query references that single definition, so the same number is returned wherever the metric is used.

Command

bruin run

Defined in

YAML + SQL

Works with

Bruin + your warehouse

What you get

single metric definitionshared aggregationsreusable dimensions

How it works in code

metrics:
  - name: active_users
    label: Active Users
    source: analytics.events
    aggregation: count_distinct
    expression: user_id
    time_dimension: event_date

Run bruin run and every chart reads the metric from one definition.

Dashboards that live in git

Open source. Write YAML, run one command, query your warehouse directly.

Sign up to our newsletter

Practical updates on open-source data pipelines, AI analysts, governance, and what we are shipping at Bruin.

The signup form is hosted by Brevo. Accept cookies to load it.