-
Notifications
You must be signed in to change notification settings - Fork 31
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,78 @@ | ||||||
--- | ||||||
id: debugging-plugins | ||||||
title: Add anonymous usage reporting | ||||||
description: How to add anonymous usage tracking to your Grafana plugin. | ||||||
keywords: | ||||||
- grafana | ||||||
- plugins | ||||||
- plugin | ||||||
- debugging | ||||||
--- | ||||||
|
||||||
# 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. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
## Setup for debugging | ||||||
|
||||||
By default Grafana docker images do not include a debug build for React. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
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. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||||||
|
||||||
To use a debug build, update your `docker-compose.yml` with the corresponding version found on hub.docker.com. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
If your plugin supports and older (supported) release, locate the tag using search option (this matches v10.2). | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
### Grafana OSS | ||||||
|
||||||
For v10.2+ OSS | ||||||
[v10.2+ OSS](https://hub.docker.com/repository/docker/grafana/grafana-oss-dev/tags?name=10.2) | ||||||
|
||||||
For 11.5+ OSS | ||||||
[v11.5+ OSS](https://hub.docker.com/repository/docker/grafana/grafana-oss-dev/tags?name=11.5) | ||||||
|
||||||
```YAML | ||||||
services: | ||||||
grafana: | ||||||
image: grafana/grafana-oss-dev:11.5.0-221762 | ||||||
... | ||||||
``` | ||||||
|
||||||
Alternatively you can use an environment variable and not modify the existing docker-compose.yml file: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alternatively, you can use an environment variable instead of modifying the existing |
||||||
|
||||||
```SHELL | ||||||
export GRAFANA_IMAGE=grafana-oss-dev | ||||||
export GRAFANA_VERSION=11.5.0-221762 | ||||||
``` | ||||||
|
||||||
### Grafana Enterprise | ||||||
|
||||||
Enterprise supports additional API calls, use this type of image when your plugin relies on Enterprise features. | ||||||
|
||||||
For v10.2+ Enterprise | ||||||
[v10.2+ Enterprise](https://hub.docker.com/repository/docker/grafana/grafana-enterprise-dev/tags?name=10.2) | ||||||
|
||||||
For 11.5+ Enterprise | ||||||
[v11.5+ Enterprise](https://hub.docker.com/repository/docker/grafana/grafana-enterprise-dev/tags?name=11.5) | ||||||
|
||||||
```YAML | ||||||
services: | ||||||
grafana: | ||||||
image: grafana/grafana-enterprise-dev:11.5.0-82747 | ||||||
... | ||||||
``` | ||||||
|
||||||
Alternatively you can use an environment variable and not modify the existing docker-compose.yml file: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
```SHELL | ||||||
export GRAFANA_IMAGE=grafana-enterprise-dev | ||||||
export GRAFANA_VERSION=11.5.0-82747 | ||||||
``` | ||||||
|
||||||
## Using React Tools | ||||||
|
||||||
Once your docker environment has started up, navigate to the instance and select | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
`View->Developer->Developer Tools` | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
There was a problem hiding this comment.
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