Metric Definition
Purpose
Metric Definition is the single-measurement contract. Its unique job is to define exactly what is measured, how to collect it, what unit it uses, whether higher or lower is better, what tolerance applies, and how dashboards, ratchets, experiments, or monitoring should interpret it.
It is not a dashboard, alert policy, or improvement backlog item. Those artifacts consume metric definitions.
Example
Show a worked example of this artifact
---
ddx:
id: example.metric-definition.depositmatch.csv-import-validation-seconds
depends_on:
- example.test-plan.depositmatch
- example.deployment-checklist.depositmatch.csv-import
---
# Metric Definition: csv-import-validation-seconds
> Store at `docs/helix/06-iterate/metrics/csv-import-validation-seconds.yaml`
```yaml
name: csv-import-validation-seconds
description: Time required to validate and summarize a representative DepositMatch CSV import fixture totaling 10,000 rows.
unit: seconds
direction: lower
command: pnpm metric:csv-import-validation -- --fixture fixtures/import/acme-10000-rows
output_pattern: "METRIC csv-import-validation-seconds=([0-9]+\\.?[0-9]*)"
tolerance: "5%"
interpretation: A value above 5 seconds violates the FEAT-001 performance target and should create an improvement backlog item unless the fixture changed.
labels:
product: depositmatch
feature: FEAT-001
area: import
signal: latency
```Reference
| Activity | Iterate — Measure, align, and improve. Close the feedback loop back into the planning strand. | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Default location | docs/helix/06-iterate/metrics/[name].yaml | ||||||||||
| Requires | None | ||||||||||
| Enables | None | ||||||||||
| Informs | Metrics Dashboard Monitoring Setup | ||||||||||
| Generation prompt | Show the full generation prompt | ||||||||||
| Template | Show the template structure |