-
Notifications
You must be signed in to change notification settings - Fork 32
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: Add info about dependencies for local development #1375
base: main
Are you sure you want to change the base?
Changes from all commits
46b3e09
b951de4
37ef13a
92fe7af
18f4601
228a4ca
4669e9b
df73c41
17a9cc0
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 | ||||
---|---|---|---|---|---|---|
|
@@ -12,6 +12,7 @@ description: Set up your development environment with Docker for Grafana plugin | |||||
- continuous integration | ||||||
- automation | ||||||
- configuration | ||||||
- dependency | ||||||
sidebar_position: 20 | ||||||
--- | ||||||
|
||||||
|
@@ -439,3 +440,36 @@ Update the `scripts` in the `package.json` to use the extended Webpack configura | |||||
-"dev": "webpack -w -c ./.config/webpack/webpack.config.ts --env development", | ||||||
+"dev": "webpack -w -c ./webpack.config.ts --env development", | ||||||
``` | ||||||
## Add a dependency for local development | ||||||
|
||||||
Grafana’s plugin development environment is designed to allow for plugins to be dependent upon other plugins if necessary. Here’s how it operates: | ||||||
|
||||||
Plugin distribution path: | ||||||
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
|
||||||
|
||||||
Refer to [Grafana documentation](https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/#plugins) for the plugin's location, which can vary depending on your system and development environment. | ||||||
|
||||||
Plugin initialization: | ||||||
|
||||||
When the Grafana server starts, its plugin loader runs a [Load](https://github.com/grafana/grafana/blob/b53f14ca83eeec6b0f624c2dbbaa417d08bbadbf/pkg/plugins/manager/loader/loader.go#L55-L56) function. This scans the defined [plugins directory](https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/#plugins) for plugins, validates `plugin.json` files, checks signatures and manifests, and initializes valid plugins. | ||||||
|
||||||
Plugin dependency management: | ||||||
|
||||||
Although some validations occur on the server side, the plugin path itself doesn't include validation of other plugins your plugin may be dependent upon. You are responsible for ensuring that your plugin's dependencies are correctly managed. | ||||||
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. This sentence is not clear, I don't really understand what is trying to tell me. Is it telling me I am responsible of installing the plugin dependencies myself? or is it telling me that I am responsible of putting the dependencies in the correct path? or something else? |
||||||
|
||||||
To manage dependencies during local plugin development, you can use one of the following methods: | ||||||
|
||||||
### Use the `GF_INSTALL_PLUGINS` environment variable | ||||||
|
||||||
* Add dependencies explicitly to your Grafana instance with `GF_INSTALL_PLUGINS=dependency`. | ||||||
josmperez marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
For example: | ||||||
|
||||||
`GF_INSTALL_PLUGINS=grafana-clock-panel` | ||||||
|
||||||
tells Grafana to install that the clock panel plugin. | ||||||
|
||||||
### Build and install the plugin | ||||||
|
||||||
* Use `GF_INSTALL_PLUGINS=your-plugin-zip-via-url` for installation. | ||||||
|
||||||
While effective, this approach can be cumbersome during rapid plugin development. |
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.