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

Docs: Using React Tools debugger with Grafana #1559

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

briangann
Copy link
Contributor

@briangann briangann commented Feb 20, 2025

What this PR does / why we need it:

Adds docs for setting up debugging tools for Grafana developers

Which issue(s) this PR fixes:

Fixes #1058

Special notes for your reviewer:

Requires grafana/grafana#101027

@CLAassistant
Copy link

CLAassistant commented Feb 20, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

github-actions bot commented Feb 20, 2025

Hello! 👋 This repository uses Auto for releasing packages using PR labels.

✨ This PR can be merged. It will not be considered when calculating future versions of the npm packages and will not appear in the changelogs.

@briangann briangann added the no-changelog Don't include in changelog and version calculations label Feb 20, 2025
@tolzhabayev tolzhabayev added the type/docs Changes only affect the documentation label Feb 20, 2025
Copy link
Contributor

@josmperez josmperez left a comment

Choose a reason for hiding this comment

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

Looks good. There are just some style and clarity issues. I'll be happy to take another look after this PR gets out of draft mode.

@@ -0,0 +1,78 @@
---
id: debugging-plugins
title: Add anonymous usage reporting
Copy link
Contributor

Choose a reason for hiding this comment

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

The title should match the H1 on line 12


# How to set up Grafana for React Tools profiling and debugging

Using the React Tools debugger in the browser is very useful when either creating a new plugin or troubleshooting an issue with an existing plugin.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Using the React Tools debugger in the browser is very useful when either creating a new plugin or troubleshooting an issue with an existing plugin.
The React Tools debugger in the browser is invaluable for developing new Grafana plugins and troubleshooting existing ones.


## Setup for debugging

By default Grafana docker images do not include a debug build for React.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
By default Grafana docker images do not include a debug build for React.
By default, Grafana Docker images do not contain a React debug build.


By default Grafana docker images do not include a debug build for React.

By using a debug build of grafana you are able to easily step through code that has not been "uglified" and also use the "Profiler" in React Dev Tools.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure what "uglified" means or why Profiler is in quotes. If Profiler is a UI element, you can put it in bold.


By using a debug build of grafana you are able to easily step through code that has not been "uglified" and also use the "Profiler" in React Dev Tools.

To use a debug build, update your `docker-compose.yml` with the corresponding version found on hub.docker.com.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
To use a debug build, update your `docker-compose.yml` with the corresponding version found on hub.docker.com.
To use a debug build, update your `docker-compose.yml` with the corresponding version found on [hub.docker.com](https://hub.docker.com/).

...
```

Alternatively you can use an environment variable and not modify the existing docker-compose.yml file:
Copy link
Contributor

Choose a reason for hiding this comment

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

Alternatively, you can use an environment variable instead of modifying the existing docker-compose.yml file:

...
```

Alternatively you can use an environment variable and not modify the existing docker-compose.yml file:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Alternatively you can use an environment variable and not modify the existing docker-compose.yml file:
Alternatively, you can use an environment variable without modifying the existing `docker-compose.yml` file:


## Using React Tools

Once your docker environment has started up, navigate to the instance and select
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Once your docker environment has started up, navigate to the instance and select
After your Docker environment starts, go to the instance and select


Once your docker environment has started up, navigate to the instance and select

`View->Developer->Developer Tools`
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
`View->Developer->Developer Tools`
**View** > **Developer** > **Developer Tools**.


`View->Developer->Developer Tools`

You can now use the "Profiler" tab in the debugging tools, which provides Flamegraph, Ranked, and Timeline options.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
You can now use the "Profiler" tab in the debugging tools, which provides Flamegraph, Ranked, and Timeline options.
You can now use the **Profiler** tab in the debugging tools, which provides Flamegraph, Ranked, and Timeline options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog Don't include in changelog and version calculations type/docs Changes only affect the documentation
Projects
Status: 🧑‍💻 In development
Development

Successfully merging this pull request may close these issues.

doc: provide basic instructions on using react debug tools with the new dev builds of Grafana
4 participants