Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error logging: Collect more context #1152

Closed
adamziel opened this issue Mar 29, 2024 · 4 comments · Fixed by #1253
Closed

Error logging: Collect more context #1152

adamziel opened this issue Mar 29, 2024 · 4 comments · Fixed by #1253
Assignees
Labels
[Type] Enhancement New feature or request [Type] Reliability Playground uptime, reliability, not crashing [Type] Repo / Project Management

Comments

@adamziel
Copy link
Collaborator

adamziel commented Mar 29, 2024

This recent report doesn't provide enough information to reproduce or reason about it"

What happened?
Not loading
Logs
[28-Mar-2024 02:42:03 UTC] Playground Error: RangeError: WebAssembly.instantiate(): Out of memory: Cannot allocate Wasm memory for new instance
Url
https://playground.wordpress.net/?url=/wp-admin/
playground.wordpress.netplayground.wordpress.net
[WordPress Playground](https://playground.wordpress.net/?url=/wp-admin/)
WordPress running in your browser for learning, testing, and

Let's also collect:

  • Exact PHP and WP build IDs/versions (it's in the URL but new deployments happen each day)
  • Type of a device, e.g. mobile phone
  • Name and version of the web browser
  • The number of open Playground tabs which we can do by asking the service worker – to figure out whether a single tab is exhausting the memory, or is it 5th
  • Available memory – if JavaScript can even provide this information
  • All error stack traces collected so far – there may be more than one

This would make it easier to reason about the incoming issues.

@adamziel adamziel added [Type] Enhancement New feature or request [Type] Repo / Project Management [Type] Reliability Playground uptime, reliability, not crashing labels Mar 29, 2024
@adamziel adamziel added this to the Zero Crashes milestone Mar 29, 2024
@adamziel adamziel changed the title Error logging: Collect more contexttual information Error logging: Collect more contextal information Mar 29, 2024
@adamziel adamziel changed the title Error logging: Collect more contextal information Error logging: Collect more context Mar 29, 2024
@flexseth
Copy link
Collaborator

@bgrgicak bgrgicak self-assigned this Apr 15, 2024
@bgrgicak
Copy link
Collaborator

Available memory – if JavaScript can even provide this information

The best I could find is a non-standard deprecated API that works only in Chrome.

@bgrgicak
Copy link
Collaborator

All error stack traces collected so far – there may be more than one

@adamziel this goes back to the start of this project. Currently, we only collect PHP and WASM crash errors.
To collect all errors we should either replace all console.... calls with custom functions, or override console... in the logger to collect all the info. Initially we decided to not do this, but seems like we want to do it now?

@bgrgicak
Copy link
Collaborator

All error stack traces collected so far – there may be more than one

@adamziel and I discussed this today and want to replace console.... calls with logger.. calls.
By default all logs will be collected in the logger, but not exposed to the browser console.
To expose logs in the console we will add a debug flag that can be controlled using the JS and query API.
To view logs in the browser we will add a modal that will list all logs. The modal can be opened manually from the head menu, or in some cases, it will open automatically, for example, if a blueprint step fails.

bgrgicak added a commit that referenced this issue Apr 19, 2024
Fixes #1152

## What is this PR doing?

It adds environment context data and the blueprint to crash reports. 

## What problem is it solving?

This should help us debug crash reports.

## How is the problem addressed?

By adding more data to the crash report. 

## Testing Instructions

- Add debug code (see [code removed in this commit
](653735a))
- Open Playground locally
- When the error report modal opens, add a description and click submit
- In the browse console see the context data

---------

Co-authored-by: Adam Zielinski <adam@adamziel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Enhancement New feature or request [Type] Reliability Playground uptime, reliability, not crashing [Type] Repo / Project Management
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants