Usage monitors
Set thresholds on Appwrite usage metrics and monitor your whole project or an individual resource from the Console or a server SDK.
9 min read
Usage monitors compare a metric with a threshold. In your project, open Observe > Monitors and click Create monitor. On Appwrite Cloud, choose Usage as the type. Under Condition, choose a Metric, what it Applies to, a comparator, and a threshold. Applies to only lists the scopes that metric supports.
You can also create a monitor from a usage chart by dragging a threshold onto it, or start from a function, site, bucket, or database.
Choose a metric and scope

Choose The whole project for a project-wide total, or a single resource when the metric supports it. Counters are summed over the period in Counted over. Gauges compare their latest reading.
| Metric | API name | Applies to | Compares |
|---|---|---|---|
| Requests | network.requests | Project | Sum |
| Inbound bandwidth | network.inbound | Project | Sum |
| Outbound bandwidth | network.outbound | Project | Sum |
| Bandwidth | network.bandwidth | Project | Sum |
| Executions | executions | Project, function, or site | Sum |
| Function executions | functions.executions | Project | Sum |
| Site executions | sites.executions | Project | Sum |
| Execution GB-hours | executions.mbSeconds | Project, function, or site | Sum |
| GB-hours | compute.mbSeconds | Project | Sum |
| Function GB-hours | functions.mbSeconds | Project | Sum |
| Site GB-hours | sites.mbSeconds | Project | Sum |
| Concurrent connections | realtime.connections | Project | Latest |
| Realtime messages sent | realtime.messages.sent | Project | Sum |
| Realtime bandwidth | realtime.bandwidth | Project | Sum |
| Monthly active users | users.mau | Project | Latest |
| Sign-ups | users | Project | Rise over the period |
| OTP attempts | auth.method.phone | Project | Sum |
| Database reads | databases.operations.reads | Project or database | Sum |
| Database writes | databases.operations.writes | Project or database | Sum |
| Collections | collections | Project or database | Latest |
| Documents | documents | Project or database | Latest |
| Database storage | databases.storage | Project or database | Latest |
| Storage used | storage | Project, database, bucket, function, or site | Latest |
| File storage | files.storage | Project | Latest |
| Messages sent | messages.sent | Project | Sum |
| SMS messages sent | messages.sms.sent | Project | Sum |
| Messages failed | messages.failed | Project | Sum |
| Topics | topics | Project | Latest |
| Webhook events sent | webhooks.events.sent | Project | Sum |
| Webhook events failed | webhooks.events.failed | Project | Sum |
| Webhooks | webhooks | Project | Latest |
| Screenshots generated | avatars.screenshotsGenerated | Project | Sum |
| Renditions encoded | renditions.success | Project | Sum |
| Failed renditions | renditions.failed | Project | Sum |
| Video encoding GB-hours | videos.mbSeconds | Project | Sum |
| Videos | videos | Project | Latest |
| Video storage | videos.storage | Project | Latest |
Bandwidth and Realtime bandwidth add inbound and outbound traffic together. GB-hours, Function GB-hours, and Site GB-hours add executions and builds together, as the compute charts on the Usage page do.
On Appwrite Cloud, dedicated databases add CPU, Memory, Disk usage, Connections, Queries per second, Read IOPS, and Write IOPS. Their API names are dedicatedDatabases.cpu, dedicatedDatabases.memory, dedicatedDatabases.storage, dedicatedDatabases.connections, dedicatedDatabases.qps, dedicatedDatabases.iopsRead, and dedicatedDatabases.iopsWrite, and each compares its latest reading. Appwrite Cloud also adds Image transformations (files.imagesTransformed), the number of images transformed in the last 30 days, for the project or a bucket. It compares its latest reading.
Deleting a database, bucket, function, or site also deletes the monitors that watch it.
Set the condition

Under Alert when the value is, choose greater than, greater than or equal, less than, or less than or equal, and enter the threshold. A usage monitor compares one metric with one threshold.
Counted over sets the period a counter is summed over, from 5 minutes to 30 days. An outbound bandwidth monitor counted over 1 hour compares the sum over the preceding hour at each check. Gauges such as storage used compare their latest reading, so the Console hides Counted over for them.
Appwrite reads usage about 2 minutes behind real time, so requests still being recorded count toward a later check. If a check has no usage reading, the monitor keeps its status and any open alert. Check the monitor's last reading in the Console before adjusting the threshold.
Create a monitor from a chart

The charts on your project's Usage page, and on a database's Monitor tab, can create a monitor for the metric they plot.
- Hover over a chart. A dashed red line and a + handle appear at its right edge.
- Click +, then drag the handle to the threshold you want. You can also move it with the arrow keys. The card next to the line reads the condition, such as Alert above 1,300 requests per hour.
- If the chart plots more than one metric, such as inbound and outbound bandwidth, pick the one to monitor in the card.
- Click Create monitor.
The create form opens with the metric, what it applies to, greater than, and your threshold filled in. For a counter, Counted over matches the chart's interval, so a line on an hourly chart creates a monitor counted over 1 hour. Review the rest of the form and click Create.
To start at a specific level, right-click the chart there and choose Create monitor above that value, or Add threshold here to place the line and keep dragging.
Monitors that already watch a chart's metric show their threshold as a red line on it, or a gray line while paused. Hover the dot at the end of a line to see the monitor's name and threshold, and click it to open the monitor. A counter's line shows only when the chart's interval matches the monitor's Counted over period. Charts hide thresholds while usage filters are applied, because a monitor can't apply those filters.
Start from a resource

Function and site pages have a Monitor menu with monitors for that resource:
| Option | Monitors |
|---|---|
| Execution spike | Executions in an hour |
| Compute usage | Execution GB-hours in a day |
| Deployment storage | Storage used by deployments and builds |
| Uptime | The site's domain, with an HTTP endpoint check. Sites only, once a domain serves the active deployment. |
| Custom monitor | Any metric the function or site supports |
Each option opens the create form scoped to the function or site, and the usage options suggest a threshold from its recent usage. View monitors shows how many monitors already watch it.
You can also right-click a function, site, bucket, or database in its list, or a resource in a usage breakdown such as executions by function, and choose Create monitor.
How often usage is checked
On Appwrite Cloud, usage monitors are checked every 15 minutes on the Free plan and every minute on paid plans. Free projects can have 3 usage monitors and Pro projects 25. See Pricing for other plans.
On self-hosted Appwrite, each usage monitor is checked every 60 seconds. Set the _APP_ALERTS_INTERVAL environment variable to change the interval in seconds. Usage monitors read the usage stats that the _APP_USAGE_STATS variable turns on. It's enabled by default. If you set it to disabled, Appwrite never checks your usage monitors.
Create with a server SDK
In your project, open Connect > API Keys and create an API key with the monitors.write scope. Then call createUsageMonitor. This monitor opens an alert when the project sends more than 1 GB of outbound bandwidth in an hour, and notifies owners and developers at Error severity.
const sdk = require('node-appwrite');
const client = new sdk.Client() .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') .setProject('<PROJECT_ID>') .setKey('<API_KEY>');
const monitors = new sdk.Monitors(client);
const monitor = await monitors.createUsageMonitor({ monitorId: 'outbound-bandwidth', name: 'Outbound bandwidth spike', rules: [sdk.Query.greaterThan('network.outbound', 1000000000)], window: 3600, // optional cooldown: 1800, // optional notify: ['owner', 'developer'], // optional severity: sdk.MonitorSeverity.Error // optional});Each monitor ID must be unique in the project, and up to 36 characters long. Pass ID.unique() to have Appwrite generate one.
| Parameter | Purpose |
|---|---|
rules | One greaterThan, greaterThanEqual, lessThan, or lessThanEqual query on a metric's API name. To watch one resource instead of the whole project, add equal queries on resourceType and resourceId. resourceType takes database, bucket, function, site, or dedicatedDatabase. Thresholds use the metric's API unit: bytes for bandwidth and storage, MB-seconds for GB-hours, a percentage for dedicated database CPU and memory, and a count otherwise. |
window | Seconds a counter is summed over, from 60 to 2,592,000. Defaults to 3,600. Gauges ignore it. |
cooldown | Minimum seconds between notifications for two alerts from this monitor, from 300 to 2,592,000. Defaults to 3,600. |
enabled | Set to false to create the monitor paused. Defaults to true. |
notify | Organization roles to notify, such as owner or developer. On Appwrite Cloud, editor, analyst, and billing also work. Defaults to ["owner"]. Pass an empty list to rely on project events alone. |
severity | info, warning, error, or critical. Defaults to warning. |
escalationId | An organization escalation to notify instead of notify. Pass an empty string on update to go back to notify. |
To read monitors back, call list with queries or get with a monitor ID. Both need the monitors.read scope. updateUsageMonitor changes only the parameters you pass, including enabled to pause or resume a monitor, and delete removes one. Both need monitors.write. Deleting a monitor resolves its open alert and keeps its alert history.
Budget alerts

Usage monitors watch a single project. To be warned about your organization's spending on Appwrite Cloud, open the organization's Billing page, turn on Budget cap, and add percentages of the cap under Billing alerts. When this billing cycle's additional usage passes one of them, and again when it reaches the cap, Appwrite notifies the roles you choose there, owners and billing members by default. Budget alerts belong to the organization, so they don't appear on a project's Monitors page. Learn more in Budget cap.
Was this page helpful?
Share what worked or what we should fix. Once approved, our agents automatically apply suggested updates to the docs.