Skip to main content

Issues

还没翻译译自英文(developers.cloudflare.com)本页 27 段都还没译

Issues provides built-in error monitoring for Cloudflare Workers. It detects production failures and groups related failures into issues without an SDK or application wrapper.

Issues overview showing occurrence totals and active and resolved issues.

Enable source maps so captured JavaScript and TypeScript exception stacks point to the original files and lines. Framework builds must generate maps as well as upload them.

How Issues works

When a Worker throws an uncaught exception, fails an invocation, returns a 5xx response, or logs an error, Issues records the failure as an occurrence. It groups related occurrences from the same Worker into one issue.

Use the Issues overview to identify recurring failures and changes in activity. To review the diagnostic context for a failure, refer to Investigate issues.

You can also create an automation to automatically send an issue to a coding agent, webhook, chat service, or incident-management tool.

Enable Issues

You can enable Issues through Wrangler, the dashboard, or the Cloudflare CLI (cf).

WranglerDashboardCloudflare CLI

Requires Wrangler 4.134.0 or later.

  1. In your Worker's Wrangler configuration file, set observability.issues.enabled to true.

    wrangler.jsoncwrangler.toml

    {
      "$schema": "./node_modules/wrangler/config-schema.json",
      "observability": {
        "issues": {
          "enabled": true
        }
      }
    }
  2. Deploy your Worker.

    npmyarnpnpm

    npx wrangler deploy

Issues processes new traffic after you enable it. It does not process historical failures. Send production traffic to the Worker, then open a detected issue in the Issues dashboard.

Report handled errors

To record an error that your application catches, pass the caught value to console.error() before returning a fallback response.

JavaScriptTypeScript

src/index.js
try {
	return await handleRequest(request);
} catch (error) {
	console.error(error);
	return new Response("Service unavailable", { status: 503 });
}

Pricing

Issues is available to all Workers accounts in open beta. It is free to use during the beta period.

Limits

LimitValue
Automations per account50
Minimum occurrence threshold1
Recurrence inactivity period1 hour to 365 days
Completed automation-run history30 days