You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/workers/observability/errors.mdx
+26-4Lines changed: 26 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -244,15 +244,37 @@ To review whether your application is experiencing any downtime or returning any
244
244
245
245
A `responseStreamDisconnected` event `outcome` occurs when one end of the connection hangs up during the deferred proxying stage of a Worker request flow. This is regarded as an error for request metrics, and presents in logs as a non-error log entry. It commonly appears for longer lived connections such as WebSockets.
246
246
247
-
##Debug exceptions
247
+
### Worker Errors
248
248
249
-
After you have identified your Workers application is returning exceptions, use `wrangler tail` to inspect and fix the exceptions.
249
+
The `Errors by invocation status` chart shows the number of errors that occurred. This graph is chart down into the following categories:
|`Uncaught Exception`| Your Worker code threw a JavaScript exception during execution. |
254
+
|`Exceeded CPU Time Limits`| Worker exceeded CPU time limit or other resource constraints. |
255
+
|`Exceeded Memory`| Worker exceeded the memory limit during execution. |
256
+
|`Internal`| An internal error occurred in the Workers runtime. |
257
+
258
+
The `Client disconnected by type` chart shows the number of client disconnect errors that occurred. This graph is chart down into the following categories:
|`Response Stream Disconnected`| Connection was terminated while streaming the response (common with WebSockets). |
263
+
|`Cancelled`| The Client disconnected before the Worker completed its response. |
264
+
265
+
## Debug exceptions with Workers Logs
266
+
267
+
[Workers Logs](/workers/observability/logs/workers-logs) is a powerful tool for debugging your Workers. It allows you to see the logs generated by your Worker, including any uncaught exceptions that occur during execution.
268
+
269
+
To find all your errors in Workers Logs, you can use the following filter: `$metadata.error EXISTS`. This will show you all the logs that have an error associated with them. You can also filter by `$workers.outcome` to find the requests that resulted in an error. For example, you can filter by `$workers.outcome = "exception"` to find all the requests that resulted in an uncaught exception. All the possible outcome values can be found in the [Workers Trace Events](logs/reference/log-fields/account/workers_trace_events/#outcome) Reference.
270
+
271
+
## Debug exceptions from `Wrangler`
272
+
273
+
To debug your worker via wrangler use `wrangler tail` to inspect and fix the exceptions.
252
274
253
275
Exceptions will show up under the `exceptions` field in the JSON returned by `wrangler tail`. After you have identified the exception that is causing errors, redeploy your code with a fix, and continue tailing the logs to confirm that it is fixed.
254
276
255
-
## Set up a logging service
277
+
## Set up a 3rd party logging service
256
278
257
279
A Worker can make HTTP requests to any HTTP service on the public Internet. You can use a service like [Sentry](https://sentry.io) to collect error logs from your Worker, by making an HTTP request to the service to report the error. Refer to your service’s API documentation for details on what kind of request to make.
0 commit comments