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 runDefined 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_dateRun bruin run and every chart reads the metric from one definition.
Related use cases
Dashboards that live in git
Open source. Write YAML, run one command, query your warehouse directly.