Skip to content

Docs: Add debugging page and how to work with runtime/trace#5134

Open
symball wants to merge 1 commit intowailsapp:masterfrom
symball:debugging
Open

Docs: Add debugging page and how to work with runtime/trace#5134
symball wants to merge 1 commit intowailsapp:masterfrom
symball:debugging

Conversation

@symball
Copy link
Copy Markdown
Contributor

@symball symball commented Apr 12, 2026

First take on debugging page

Summary by CodeRabbit

  • Documentation
    • Added a new debugging guide that walks through collecting and visualizing Go runtime performance traces for Wails apps, with step-by-step profiling and visualization instructions.
  • Chores
    • Updated the unreleased changelog to add an entry announcing the new debugging guide.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 12, 2026

Walkthrough

Added a new "Debugging" documentation page describing how to collect and visualize Go runtime traces for Wails apps using runtime/trace, go tool trace, and Graphviz; updated the unreleased changelog to mention the new page.

Changes

Cohort / File(s) Summary
Debugging Documentation
docs/src/content/docs/guides/dev/debugging.mdx
New guide page with frontmatter and Starlight UI imports; step-by-step instructions to start/stop runtime/trace, run the app to generate trace.out, install Graphviz, and visualize traces with go tool trace (recommendation: Syscall profile).
Unreleased Changelog
v3/UNRELEASED_CHANGELOG.md
Replaced placeholder with an "Added" entry noting the debugging page and usage of runtime/trace.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested labels

Documentation, lgtm

Suggested reviewers

  • leaanthony

Poem

🐇 I hopped through traces, tiny and bright,
I watched the runtime hum into the night.
With Graphviz colors and a rabbit's cheer,
Performance secrets soon appeared near.
Hop on — debug delights are here!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is extremely minimal and does not follow the required template structure with proper sections, issue references, type of change, testing details, or checklist completion. Expand the description to include the required sections: issue reference (Fixes #), type of change selection, testing information, and completed checklist items per the template.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title accurately summarizes the main change: adding a debugging documentation page with runtime/trace guidance.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/src/content/docs/guides/dev/debugging.mdx`:
- Around line 11-13: Revise the introductory sentence so it reads clearly and
concisely; replace the awkward "We will demonstrate use of various tools to
provide how to inspect and investigate possible performance issues within your
Wails app using" with a tightened version such as "We will demonstrate various
tools to inspect and investigate performance issues in your Wails app,
including:", then keep the existing bullet for runtime/trace to follow that
lead-in.
- Around line 73-75: Update the prose to use compound-word hyphenation: replace
"Chrome based" with "Chrome-based" and "first time users" with "first-time
users" in the sentence that currently reads "This should open up your default
browser (recommended to use Chrome based)..." and the sentence starting "For
first time users, the `Syscall profile`..."; keep the rest of the text
unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1c7a11eb-fa05-4cac-babc-ecd8d0fc91f8

📥 Commits

Reviewing files that changed from the base of the PR and between bb4fbf9 and e64303e.

📒 Files selected for processing (1)
  • docs/src/content/docs/guides/dev/debugging.mdx

Comment on lines +11 to +13
We will demonstrate use of various tools to provide how to inspect and investigate possible performance issues within your Wails app using
- [`runtime/trace`](https://pkg.go.dev/runtime/trace) to create performance graphs and inspect them in a browser

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Tighten the intro sentence for clarity.

Line 11 reads awkwardly (“provide how to inspect”). A small wording fix will improve readability.

✏️ Proposed wording tweak
-We will demonstrate use of various tools to provide how to inspect and investigate possible performance issues within your Wails app using
+This guide demonstrates tools you can use to inspect and investigate potential performance issues in your Wails app:
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
We will demonstrate use of various tools to provide how to inspect and investigate possible performance issues within your Wails app using
- [`runtime/trace`](https://pkg.go.dev/runtime/trace) to create performance graphs and inspect them in a browser
This guide demonstrates tools you can use to inspect and investigate potential performance issues in your Wails app:
- [`runtime/trace`](https://pkg.go.dev/runtime/trace) to create performance graphs and inspect them in a browser
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/src/content/docs/guides/dev/debugging.mdx` around lines 11 - 13, Revise
the introductory sentence so it reads clearly and concisely; replace the awkward
"We will demonstrate use of various tools to provide how to inspect and
investigate possible performance issues within your Wails app using" with a
tightened version such as "We will demonstrate various tools to inspect and
investigate performance issues in your Wails app, including:", then keep the
existing bullet for runtime/trace to follow that lead-in.

Comment on lines +73 to +75
This should open up your default browser (recommended to use Chrome based) with the trace event viewer home page.

For first time users, the `Syscall profile` screen is probably the most useful. This provides a breakdown of exactly what the program is doing along with timings
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix hyphenation in user-facing prose.

Use compound-word hyphenation on Line 73 and Line 75 for polished docs copy (Chrome-based, first-time).

✏️ Proposed copy edit
-This should open up your default browser (recommended to use Chrome based) with the trace event viewer home page.
+This should open your default browser (a Chrome-based browser is recommended) with the trace event viewer home page.

-For first time users, the `Syscall profile` screen is probably the most useful.
+For first-time users, the `Syscall profile` screen is probably the most useful.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
This should open up your default browser (recommended to use Chrome based) with the trace event viewer home page.
For first time users, the `Syscall profile` screen is probably the most useful. This provides a breakdown of exactly what the program is doing along with timings
This should open your default browser (a Chrome-based browser is recommended) with the trace event viewer home page.
For first-time users, the `Syscall profile` screen is probably the most useful. This provides a breakdown of exactly what the program is doing along with timings
🧰 Tools
🪛 LanguageTool

[grammar] ~73-~73: Use a hyphen to join words.
Context: ...fault browser (recommended to use Chrome based) with the trace event viewer home ...

(QB_NEW_EN_HYPHEN)


[grammar] ~75-~75: Use a hyphen to join words.
Context: ...e event viewer home page. For first time users, the Syscall profile screen...

(QB_NEW_EN_HYPHEN)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/src/content/docs/guides/dev/debugging.mdx` around lines 73 - 75, Update
the prose to use compound-word hyphenation: replace "Chrome based" with
"Chrome-based" and "first time users" with "first-time users" in the sentence
that currently reads "This should open up your default browser (recommended to
use Chrome based)..." and the sentence starting "For first time users, the
`Syscall profile`..."; keep the rest of the text unchanged.

@leaanthony
Copy link
Copy Markdown
Member

Thanks 🙏 Please could you add an entry to the changelog located at v3/UNRELEASED_CHANGELOG.md? Thanks!

* Rework command initiation to use cobra / viper
* abstract init builder away from command package
@symball
Copy link
Copy Markdown
Contributor Author

symball commented Apr 16, 2026

v3/UNRELEASED_CHANGELOG.md has been updated

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (2)
docs/src/content/docs/guides/dev/debugging.mdx (2)

11-13: ⚠️ Potential issue | 🟡 Minor

Revise the awkward introductory sentence.

The phrasing "provide how to inspect" is grammatically unclear. This was previously flagged but remains unfixed.

✏️ Proposed wording improvement
-We will demonstrate use of various tools to provide how to inspect and investigate possible performance issues within your Wails app using
+This guide demonstrates tools you can use to inspect and investigate potential performance issues in your Wails app:
 - [`runtime/trace`](https://pkg.go.dev/runtime/trace) to create performance graphs and inspect them in a browser
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/src/content/docs/guides/dev/debugging.mdx` around lines 11 - 13, The
introductory sentence "We will demonstrate use of various tools to provide how
to inspect and investigate possible performance issues within your Wails app
using - [`runtime/trace`]" is awkward; replace it with a clear, grammatical
sentence such as: "This guide demonstrates tools for inspecting and
investigating performance issues in your Wails app, including [`runtime/trace`]
for creating performance traces you can view in a browser." Update the sentence
in the dev/debugging.mdx content where that exact phrasing appears and preserve
the runtime/trace link.

73-75: ⚠️ Potential issue | 🟡 Minor

Fix compound adjective hyphenation.

Use hyphens for compound adjectives as flagged by static analysis. This was previously identified but remains unfixed.

✏️ Proposed hyphenation fixes
-    This should open up your default browser (recommended to use Chrome based) with the trace event viewer home page.
+    This should open your default browser (a Chrome-based browser is recommended) with the trace event viewer home page.
 
-    For first time users, the `Syscall profile` screen is probably the most useful. This provides a breakdown of exactly what the program is doing along with timings
+    For first-time users, the `Syscall profile` screen is probably the most useful. This provides a breakdown of exactly what the program is doing along with timings
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/src/content/docs/guides/dev/debugging.mdx` around lines 73 - 75, The
text contains un-hyphenated compound adjectives—update the phrases "Chrome
based" to "Chrome-based" and "first time users" to "first-time users" (and apply
similar hyphenation to any other compound adjectives in the same paragraph,
e.g., consider "trace event viewer" as "trace-event-viewer" if used as a
modifier) so the guide follows correct compound-adjective hyphenation rules.
🧹 Nitpick comments (2)
docs/src/content/docs/guides/dev/debugging.mdx (2)

22-42: Consider adding import statements for clarity.

The code example omits the necessary import statements. While experienced developers will know what to import, showing them explicitly would help beginners.

📦 Proposed addition of imports
+    ```go
+    import (
+      "log"
+      "os"
+      "runtime/trace"
+    )
+    ```
+
     ```go
     // Create the file to store our trace data within
     traceFile, err := os.Create("trace.out")
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/src/content/docs/guides/dev/debugging.mdx` around lines 22 - 42, The
example is missing required imports; add an import block including "log", "os",
and "runtime/trace" at the top of the snippet so functions like os.Create,
log.Fatalf and trace.Start resolve; ensure the import block appears before the
code that calls trace.Start/trace.Stop and matches the same code fence language
(go).

44-44: Improve formatting of trace function references.

The trace functions WithRegion, NewTask, Log could be clearer if formatted as package-qualified identifiers or linked to their documentation.

✨ Suggested improvement
-The default trace is quite raw; you are well advised to do further reading on trace to add more contextual information and limit what you actually record. For example: `WithRegion, NewTask, Log`
+The default trace is quite raw; you are well advised to do further reading on the trace package to add more contextual information and limit what you actually record. For example: `trace.WithRegion`, `trace.NewTask`, `trace.Log`
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/src/content/docs/guides/dev/debugging.mdx` at line 44, Update the inline
examples to present the trace functions as package-qualified identifiers or link
them to their docs: replace "WithRegion, NewTask, Log" with "trace.WithRegion,
trace.NewTask, trace.Log" (or add markdown links to each function's
documentation), so readers can clearly see the API owner and click through to
docs; ensure the update is made in the sentence referencing the default trace in
the debugging guide where those symbols appear.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@docs/src/content/docs/guides/dev/debugging.mdx`:
- Around line 11-13: The introductory sentence "We will demonstrate use of
various tools to provide how to inspect and investigate possible performance
issues within your Wails app using - [`runtime/trace`]" is awkward; replace it
with a clear, grammatical sentence such as: "This guide demonstrates tools for
inspecting and investigating performance issues in your Wails app, including
[`runtime/trace`] for creating performance traces you can view in a browser."
Update the sentence in the dev/debugging.mdx content where that exact phrasing
appears and preserve the runtime/trace link.
- Around line 73-75: The text contains un-hyphenated compound adjectives—update
the phrases "Chrome based" to "Chrome-based" and "first time users" to
"first-time users" (and apply similar hyphenation to any other compound
adjectives in the same paragraph, e.g., consider "trace event viewer" as
"trace-event-viewer" if used as a modifier) so the guide follows correct
compound-adjective hyphenation rules.

---

Nitpick comments:
In `@docs/src/content/docs/guides/dev/debugging.mdx`:
- Around line 22-42: The example is missing required imports; add an import
block including "log", "os", and "runtime/trace" at the top of the snippet so
functions like os.Create, log.Fatalf and trace.Start resolve; ensure the import
block appears before the code that calls trace.Start/trace.Stop and matches the
same code fence language (go).
- Line 44: Update the inline examples to present the trace functions as
package-qualified identifiers or link them to their docs: replace "WithRegion,
NewTask, Log" with "trace.WithRegion, trace.NewTask, trace.Log" (or add markdown
links to each function's documentation), so readers can clearly see the API
owner and click through to docs; ensure the update is made in the sentence
referencing the default trace in the debugging guide where those symbols appear.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 038b4812-b367-488e-b25f-107309edc25d

📥 Commits

Reviewing files that changed from the base of the PR and between e64303e and ae38e94.

📒 Files selected for processing (2)
  • docs/src/content/docs/guides/dev/debugging.mdx
  • v3/UNRELEASED_CHANGELOG.md
✅ Files skipped from review due to trivial changes (1)
  • v3/UNRELEASED_CHANGELOG.md

@leaanthony leaanthony changed the base branch from v3-alpha to master April 29, 2026 13:08
@leaanthony
Copy link
Copy Markdown
Member

Triaged by Wails PR Reviewer

This PR has been reviewed and accepted.

Head Ref OID: ae38e94b7b2cc072ba51106cafeef88dd4e1cc37


This comment serves as a signature that this PR has been triaged. Future runs will skip this PR based on the headRefOid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants