Skip to content

preview: monitors, alerts and escalations (do not merge) - #184

Closed
ChiragAgg5k wants to merge 1 commit into
mainfrom
preview/monitors
Closed

ChiragAgg5k wants to merge 1 commit into
mainfrom
preview/monitors

Conversation

@ChiragAgg5k

@ChiragAgg5k ChiragAgg5k commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Preview of an unreleased API for review. Do not merge.

Generated from appwrite/appwrite#16079 and appwrite/appwrite#16080. Escalations have no server SDK methods in this preview: their routes do not accept API keys.

import { Alerts, AlertStatus, Client, ID, Monitors, MonitorSeverity, Query } from 'node-appwrite';

const client = new Client().setEndpoint('https://<REGION>.cloud.appwrite.io/v1').setProject('<PROJECT_ID>').setKey('<API_KEY>');
const monitors = new Monitors(client);
const alerts = new Alerts(client);

const monitor = await monitors.createHttpMonitor({
    monitorId: ID.unique(),
    name: 'API health',
    url: 'https://api.example.com/health',
    rules: [Query.or([Query.notBetween('statusCode', 200, 299), Query.greaterThan('latency', 2000)])],
    severity: MonitorSeverity.Critical,
});

await monitors.updateHttpMonitor({ monitorId: monitor.$id, interval: 30 });

const firing = await alerts.list({
    queries: [Query.equal('monitorId', monitor.$id), Query.equal('status', AlertStatus.Firing)],
});
for (const alert of firing.alerts) {
    await alerts.update({ alertId: alert.$id, acknowledged: true });
}

Part of: appwrite-labs/cloud#6564

Generated from appwrite/appwrite#16079 and #16080 for review before the API is frozen. Not for release.
@ChiragAgg5k ChiragAgg5k self-assigned this Nov 25, 2026
@ChiragAgg5k

Copy link
Copy Markdown
Member Author

Superseded by #186, which releases the final monitors, alerts and escalations contract.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant