Skip to content

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

InputTypeRequiredDescription
metricMetricrequiredThe Metric to watch.
thresholdnumberrequiredThe value that trips it.
directionstringrequiredTrip when the Metric goes above or below the threshold.

Outputs

OutputTypeRequiredDescription
watchWatchrequiredThe Watch that checks it.
metricMetricrequiredThe Metric now watched.

Effects

  • Emits Metric.watched.
  • Performed by the Analyst.
  • Two-way: it runs at once, in the try, send and do modes.
  • A guardrail Metric that trips stops its Experiment at once, with no delay window.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.Metric.watch

When it waits

GateDefault
Decision classLow: two-way, nothing at stake
Delay windowNone: it runs once review passes.
LimitThe call Limit of the Permission it runs under.
Over the LimitIt 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.