Metric .watch
POST /{namespace}/metrics/{metric}/watch
Watch alerts the owner of a Metric when it crosses a threshold, by a Task or a Message.
- Noun
- Metric
- Mode
do- Event
Metric.watched
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
metric | Metric | required | The Metric to watch. |
threshold | number | required | The value that trips it. |
direction | string | required | Trip when the Metric goes above or below the threshold. |
Outputs
| Output | Type | Required | Description |
|---|---|---|---|
watch | Watch | required | The Watch that checks it. |
metric | Metric | required | The Metric now watched. |
Effects
- Emits
Metric.watched. - Performed by the Analyst.
- Two-way: it runs at once, in the
try,sendanddomodes. - A guardrail Metric that trips stops its Experiment at once, with no delay window.
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | Metric.watch |
When it waits
| Gate | Default |
|---|---|
| Decision class | Low: two-way, nothing at stake |
| Delay window | None: it runs once review passes. |
| Limit | The call Limit of the Permission it runs under. |
| Over the Limit | It waits pending for an Approval from the Founder. Approved, it runs; refused, it ends refused with limit-exceeded; unanswered by its deadline, it ends canceled. |