Skip to Content
MonitoringMonitors

Monitors

A monitor watches a contract and opens an alert episode when something is wrong. Destinations are notified when an episode opens, escalates and recovers.

There are two kinds.

Kind
Default monitorsThree checks every watched contract gets. No setup.
Custom monitorsA rule you write against a metric, with your own thresholds.
Metric → Monitor → Healthy | Warning | Alerting → Alert episode → Notification

Warning and Alerting are determined by the value. There is no severity or priority setting.

Default monitors

Default monitors run on every watched contract. Each has one tier, Alerting, and none judges against a fixed number: a default fires on something that changed, or on the contract’s own normal.

MonitorWatchesAlerts whenCloses when
Control changeThe contract’s owner, proxy admin, implementation, beacon and paused stateThe owner or admin changes, the implementation or beacon is upgraded, or the contract is paused or unpausedA day after the newest change
Dependency failureCalls the contract makes to other contracts, per callee and method, that revert and fail the transactionAt least 2 such failures make up at least half of the calls to that callee and method in the last hour, on a dependency that was working before. A rarely called one is judged over 6 hoursNo callee fails that way over its window
Revert spikeThe share of transactions touching the contract that revertedThe last hour’s rate is above twice the contract’s own rate over the prior week and above 2%, on at least 5 failures in 20 transactions. Needs 6 hours of history firstThe rate drops back under the line
  • One monitor of each kind per workspace, covering every watched contract. Each contract gets its own episode.
  • Judged every minute. Dependency failure every five minutes. A revert the contract catches is not counted.
  • A default notifies every destination, including ones connected later, until narrowed on its page.
  • A contract can be excluded from a default, on its page or with contract.dev monitor exclude. A default can be switched off, not deleted.
  • A control change is a record, not a condition: its episode is notified once, never reminded, and closes without a recovery message.

Add a monitor

Open Monitoring and select Add monitor.

Step
MetricChain, address, and the value to read. Same picker as tracking a metric; the value is tracked if it isn’t already. Any address is accepted.
ThresholdsThe alert threshold, and an optional warning threshold on the healthy side of it.
NotificationsDestinations. Every connected destination is selected to begin with. A monitor with none selected still opens episodes; it notifies nobody.
contract.dev monitor add "Treasury · Native balance" --below 25000 --warn 30000 --to telegram

Rules

RuleAlerts when
Falls below nmetric drops below n
Rises above nmetric rises above n
Falls below metric Bmetric A drops below metric B
Rises above metric Bmetric A rises above metric B

For rules between two metrics, the warning tier is a percentage margin: reserves >= liabilities with a 5% warning warns when reserves are within 5% of liabilities. Comparisons are exact.

States

State
HealthyThe latest reading satisfies the rule.
WarningPast the warning threshold, not past the alert threshold. An episode is open.
AlertingPast the alert threshold. An episode is open.
No dataThe metric has no reading yet.
DisabledSwitched off. Not evaluated, no notifications.

A default monitor’s state is the worst of its contracts’.

Evaluation

Custom monitors evaluate on every new reading of their metric. For balance, supply and function-call metrics, a crossing is re-read at the block it was seen before an episode opens or escalates. Recovery takes effect on the first reading back inside the rule.

Monitoring page

The header shows the healthy, warning and alerting counts. The rail on the left lists watched contracts with their health; select one to narrow the page to it, select it again to widen. The scope is stored in the URL.

View
MonitorsThe default monitors, with the contracts each covers, its reading and when it last fired; then the custom monitors, with state, current value, thresholds, room left before the alert threshold and last trigger. Sort by state; search by name, rule, metric or address. Edit or delete a custom monitor from its row.
HistoryOpen and recovered episodes over a window of 24h to 90d, open ones first, then newest first. Filter to open or recovered. Acknowledge inline. An episode that names a transaction opens it in Activity.
DestinationsWhere alerts are sent. Connect, test and remove destinations.

Monitor page

A custom monitor’s page: the metric’s chart with thresholds drawn and episodes shaded; state, time healthy, episode count, time alerting and longest episode; the metric, its current value and last sample, the thresholds, the distance to the alert threshold and the last trigger; episode history; destinations; edit, disable, delete. Deleting a monitor deletes its episodes.

A default monitor’s page: the contracts it covers with each one’s state, exclude and include; episode history across them; what it watches and when it alerts; destinations; switch off.

Snooze and disable

Snooze mutes notifications until a set time; evaluation and history continue. Disable stops evaluation. Disable from the monitor page, the Monitors view or the CLI; snooze from the CLI.

Last updated on