Usage limits
A usage limit watches one metric of a deployment, such as function calls, over a day or a month. A warning limit tells your team when usage reaches it. A disable limit pauses the deployment, so its function calls fail.
Warn at a limit
Section titled “Warn at a limit”yield* Convex.UsageLimit("Calls", { deployment, metric: "functionCalls", window: "month", limitType: "warning", limit: 1_000_000,});window is day or month. A deployment has one limit per metric, window and type.
Stop at a limit
Section titled “Stop at a limit”yield* Convex.UsageLimit("Stop", { deployment, metric: "functionCalls", window: "month", limitType: "disable", limit: 5_000_000,});disable pauses the deployment when it reaches the limit.
Turn a limit off
Section titled “Turn a limit off”yield* Convex.UsageLimit("Calls", { deployment, metric: "functionCalls", window: "month", limitType: "warning", limit: 1_000_000, enabled: false,});