-
Notifications
You must be signed in to change notification settings - Fork 11
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 how to develop locally #137
Conversation
Code coverage report for PR #137
|
CONTRIBUTING.md
Outdated
yarn install | ||
``` | ||
|
||
3. Grafana will look for plugins, by default, on its `data/plugins` directory. You can create a symbolic link to your plugin repository to detect new changes: |
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.
Is it worth mentioning that it can be done in a conf/custom.ini
file too?
Or would you say a symlink is a preferred way?
[paths]
provisioning = /Users/xxx/code/plugin-provisioning/provisioning
plugins = /Users/xxx/code/plugins
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.
both approaches are valid 👍
CONTRIBUTING.md
Outdated
yarn start | ||
``` | ||
|
||
After this, you should be able to see your plugin listed in Grafana and test your changes. Note that any change in the fronted will require you to refresh your browser while changes in the backend may require to rebuild your plugin binaries and restart the Grafana backend. |
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.
for backend using mage && mage reloadPlugin
?
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.
A very nice addition ! 👏
It does seem tedious to add in every plugin repo but I feel it's a good start and definitely worth having that somewhere!
I agree that @grafana/docs-squad might be able to point us towards somewhere else, maybe in grafana's own contributing file ?
CONTRIBUTING.md
Outdated
@@ -46,6 +46,45 @@ Make sure you have the following dependencies installed first: | |||
mage -v | |||
``` | |||
|
|||
## Local development with Grafana |
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.
Local development with local Grafana?
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.
(avoided one "local" because of redundancy)
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.
Nice!
Not all contributors have the need to run grafana locally. I wonder if we should also start providing docker-compose files for all our plugins that will allow enable running the plugin without cloning Grafana? I sometimes find this useful myself. Thoughts @andresmgot @yaelleC?
version: '3.7'
services:
grafana:
image: grafana/grafana:latest
ports:
- '3000:3000'
volumes:
- ./:/var/lib/grafana/plugins/redshift-datasource
- ./provisioning:/etc/grafana/provisioning
environment:
- TERM=linux
- GF_LOG_LEVEL=debug
- GF_DATAPROXY_LOGGING=true
Good call! That seems very useful to plugin contributors, less hassle 👍 |
This information will surely help the community. Thanks for putting this together. Are these instructions generic and can be used to build any plugin? As far as location goes, I will recommend that we add this content as a topic after this: https://grafana.com/docs/grafana/latest/developers/plugins/. What do you think? |
Yes good catch! Probably good to include a storage volume too. Something like this version: '3.7'
services:
grafana:
image: grafana/grafana:latest
ports:
- '3090:3000'
volumes:
- ./:/var/lib/grafana/plugins/redshift-datasource
- grafana-storage:/var/lib/grafana
- ./[path-to-provisioning]:/etc/grafana/provisioning
environment:
- COMPOSE_INTERACTIVE_NO_CLI=1
- TERM=linux
- GF_LOG_LEVEL=debug
- GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=grafana-redshift-datasource
volumes:
grafana-storage:
|
Thanks for the comments! I am going to move now this guide to https://grafana.com/docs/grafana/latest/developers/plugins/. |
Moved the doc to grafana/grafana#47121 :) |
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.
Looks great!
No doubt that will be quite useful!
We could wait until the grafana guide is up before merging this PR ;)
This can be finally merged |
I have received the same question lately a couple of times. It's not documented anywhere how to develop a plugin locally with Grafana so adding it here. Maybe @grafana/docs-squad can suggest a better place for a guide like this? (rather than having to write this for each plugin).