Metacenta

Documentation · rule metric-undocumented

dbt metrics with no description

A Metacenta review checks this under the rule Metrics say what they measure. Everything below applies whether or not you ever commission one.

What this rule checks

This rule flags every metric in a dbt semantic layer with no description. A label alone does not count, because it names the metric rather than defining it.

Why it matters

The people who read a metric by name are the least able to open its definition. Two teams can quote the same label and mean different numbers, and neither can tell from the dashboard.

How to fix it

Describe what every metric counts and excludes. Describe what the metric counts and what it excludes: refunds, currency, and which date it is measured by.

Before:

metrics:
  - name: net_revenue
    label: Net revenue
    type: simple
    type_params:
      measure: order_total

After:

metrics:
  - name: net_revenue
    label: Net revenue
    description: >
      Order value after discounts and full refunds, before tax,
      in GBP, by the date the order was placed.
    type: simple
    type_params:
      measure: order_total

When it is fine to leave

Rarely. A metric exists to be read by people who will not open its YAML. A project with no metrics is not judged at all; whether to define them is a choice, not a finding.

What we need to check it

manifest.json from a project that defines metrics.