Skip to content

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

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.

from appwrite.client import Client
from appwrite.enums.alert_status import AlertStatus
from appwrite.enums.monitor_severity import MonitorSeverity
from appwrite.id import ID
from appwrite.query import Query
from appwrite.services.alerts import Alerts
from appwrite.services.monitors import Monitors

client = Client().set_endpoint('https://<REGION>.cloud.appwrite.io/v1').set_project('<PROJECT_ID>').set_key('<API_KEY>')
monitors = Monitors(client)
alerts = Alerts(client)

monitor = monitors.create_http_monitor(
    monitor_id=ID.unique(),
    name='API health',
    url='https://api.example.com/health',
    rules=[Query.or_queries([Query.not_between('statusCode', 200, 299), Query.greater_than('latency', 2000)])],
    severity=MonitorSeverity.CRITICAL,
)

monitors.update_http_monitor(monitor_id=monitor.id, interval=30)

firing = alerts.list(queries=[Query.equal('monitorId', monitor.id), Query.equal('status', AlertStatus.FIRING.value)])
for alert in firing.alerts:
    alerts.update(alert_id=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 #184, 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