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
* add outcome values to the workers_trace_events docs
* improve the workers observability errors documentation
* improve the workers observability errors documentation
* try to fix the link
* the trace item schema is updated automatically
* Update src/content/docs/workers/observability/errors.mdx
Co-authored-by: Kody Jackson <[email protected]>
---------
Co-authored-by: Thomas Ankcorn <[email protected]>
Co-authored-by: Kody Jackson <[email protected]>
Copy file name to clipboardExpand all lines: src/content/docs/workers/observability/errors.mdx
+27-5Lines changed: 27 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -242,17 +242,39 @@ To review whether your application is experiencing any downtime or returning any
242
242
2. In **Account Home**, select **Workers & Pages**.
243
243
3. In **Overview**, select your Worker and review your Worker's metrics.
244
244
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.
245
+
### Worker Errors
246
246
247
-
## Debug exceptions
247
+
The **Errors by invocation status** chart shows the number of errors broken down into the following categories:
248
248
249
-
After you have identified your Workers application is returning exceptions, use `wrangler tail` to inspect and fix the exceptions.
|`Response Stream Disconnected`| Connection was terminated during the deferred proxying stage of a Worker request flow. It commonly appears for longer lived connections such as [WebSockets](/workers/runtime-apis/websockets/). |
261
+
|`Cancelled`| The Client disconnected before the Worker completed its response. |
262
+
263
+
## Debug exceptions with Workers Logs
264
+
265
+
[Workers Logs](/workers/observability/logs/workers-logs) is a powerful tool for debugging your Workers. It shows all the historic logs generated by your Worker, including any uncaught exceptions that occur during execution.
266
+
267
+
To find all your errors in Workers Logs, you can use the following filter: `$metadata.error EXISTS`. This will show 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.
268
+
269
+
All the possible outcome values can be found in the [Workers Trace Event](/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