@@ -323,15 +323,27 @@ authentication:
323323}
324324```
325325
326- ## WAHA Debug Mode
327- If you enable ` WAHA_DEBUG_MODE=True ` , WAHA exposes a few additional features for helping with
328- troubleshooting (usually Memory and CPU-related issues) .
326+ ## Troubleshooting
327+ There's few internal tools to help us (as developers) understand what it's going on under the hood.
328+ The below section you can use if you have any problem, and we asked to collect additional information .
329329
330- {{< callout context="caution" icon="outline/info-circle" >}}
331- ` WAHA_DEBUG_MODE=True ` is for ** troubleshooting** purposes only
330+ ### Enable Debug Mode
331+ By default, debug mode is off.
332+
333+ Enable it by adding ` WAHA_DEBUG_MODE ` environment variable:
334+ ``` bash
335+ WAHA_DEBUG_MODE=True
336+ ```
337+
338+ ### ALL - Get Node.js heapsnapshot
339+ {{< callout context="note" icon="outline/info-circle" >}}
340+ Works with all engines: ** WEBJS** , ** GOWS** , ** NOWEB**
332341{{< /callout >}}
333342
334- ### Get Node.js heapsnapshot
343+ - Add ` WAHA_DEBUG_MODE=True ` env variable
344+ - Restart container
345+ - Execute request (only when the issue's happening to collect the most recent information)
346+
335347``` http request
336348GET /api/server/debug/heapsnapshot
337349```
@@ -344,7 +356,15 @@ then click on **Download File**:
344356
345357![ Swagger - Download File] ( swagger-download-file.png )
346358
347- ### Get Browser Trace
359+ ### WEBJS - Get Browser Trace
360+ {{< callout context="note" icon="outline/info-circle" >}}
361+ Works only with ** WEBJS** engine
362+ {{< /callout >}}
363+
364+ - Add ` WAHA_DEBUG_MODE=True ` env variable
365+ - Restart container
366+ - Execute request (only when the issue's happening to collect the most recent information)
367+
348368``` http request
349369GET /api/server/debug/browser/trace/{SESSION}?seconds=30&categories=%2A
350370```
@@ -370,19 +390,33 @@ then click on **Download File**:
370390![ Swagger - Download File] ( swagger-download-file.png )
371391
372392
373- ### GOWS pprof
393+ ### GOWS - pprof
394+ {{< callout context="note" icon="outline/info-circle" >}}
395+ Works only with ** GOWS** engine
396+ {{< /callout >}}
374397
375- You can expose the ` 6060 ` port and connect using pprof for the ** GOWS** engine:
398+ - Add ` WAHA_DEBUG_MODE=True ` env variable
399+ - Expose ` 6060 ` port from the docker (see yaml below)
376400
377- ``` bash
378- go tool pprof -http=:8081 http://localhost:6060/debug/pprof/heap
379- ```
380-
381- Make sure to add it to docker-compose:
382- ``` yaml
401+ ``` yaml {title="docker-compose.yaml"}
383402services :
384403 waha :
385404 image : devlikeapro/waha-plus
386405 ports :
387406 - " 127.0.0.1:6060:6060"
388407` ` `
408+
409+ - Restart container
410+ - Use ` curl` to collect heap when issue is happening
411+
412+ ` ` ` bash {title="Download heap"}
413+ curl -s http://localhost:6060/debug/pprof/heap > heap.pb.gz
414+ ` ` `
415+ - Send `heap.pb.gz` to developers
416+
417+ - **OR** you can connect and debug it online using built-in http server:
418+
419+ ` ` ` bash {title="Connect to pprof"}
420+ go tool pprof -http=:8081 http://localhost:6060/debug/pprof/heap
421+ ` ` `
422+
0 commit comments