Course overview/Build the model3 of 3

Metric in the asset

Metric in the asset

Keep the definition, owner, currency basis, and limitation beside the mart that implements it.

Put the definition where changes happen

A mart header is part of the model. Use a folded description for the grain and metric, tags for selection and layer, and meta for business_owner, metric_definition, currency, expected_update, and known_limitation.

A metric definition in chat disappears from the next agent session and the next code review. A definition in meta.metric_definition travels with the SQL and can be challenged alongside it. The mart must depend on staging or core assets, never a raw source table.

Your task

Create pipeline/assets/mart/weekly_category_revenue.sql from your lesson-two contract. Add the folded description, layer:mart and domain:commerce tags, every required meta field, and dependencies that preserve the layered project. Run bruin validate.

Check your understanding

  • Where does this course put a metric's exact definition, and why not in a chat thread?
  • pipeline/pipeline.yml sets owner and domains under default: for every asset. When should weekly_category_revenue.sql set its own owner?
  • Name the five meta fields this lesson teaches for a mart asset carrying a metric.

Do it with your agent

Say next lesson, write the asset yourself, then say review my work. The agent should inspect the header, dependency lineage, real values in metadata, and a clean validation result.

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. Allow marketing cookies to load it.