Metric.defined
Emitted each time a Metric is defined.
Metric.define emits Metric.defined when it completes on a Metric.
| Property | Value |
|---|---|
| Emitted by | Metric.define |
| Noun | Metric |
| Moves | Metric draft to defined |
| Wakes | None. |
Payload
Each delivery is an Event record. data holds what Metric.define returns, and previous holds the state it left.
| Field | Type | Required | Description |
|---|---|---|---|
name | string | required | Metric.defined. |
at | datetime | required | When it happened. |
seq | integer | Its position in the namespace, one more than the Event before; any seq is a cursor into the history. | |
data | json | required | The Thing as the Action left it. |
data.metric | Metric | required | The defined Metric. |
data.metric.query | text | required | How it is computed. An agent never varies the Metrics it is judged by. |
data.metric.unit | string | The unit, such as dollars or percent. | |
data.metric.status | string | required | One of draft or defined. |
data.previous.status | string | required | The status before this Event: draft. |
Example
{
"$id": "https: //api.sb/ kilnbakery.com/ events/ event_1",
"$type": "Event",
"name": "Metric.defined",
"at": "2026-10-22T12: 00: 00Z",
"data": {
"metric": {
"$id": "https: //api.sb/ kilnbakery.com/ metrics/ metric_1",
"$type": "Metric",
"query": "Example query",
"unit": "Example unit",
"status": "defined"
},
"previous": {
"status": "draft"
}
},
"seq": 1
}