The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/docs/sources/shared/tutorials/publish-your-plugin.md

2.3 KiB

labels title
[{products [enterprise oss]}] Package your plugin

Once you're happy with your plugin, it's time to package it, and submit to the plugin repository.

For users to be able to use the plugin without building it themselves, you need to make a production build of the plugin, and commit to a release branch in your repository.

To submit a plugin to the plugin repository, you need to create a release of your plugin. While we recommend following the branching strategy outlined below, you're free to use one that makes more sense to you.

Create a plugin release

Let's create version 0.1.0 of our plugin.

  1. Create a branch called release-0.1.x.

    git checkout -b release-0.1.x
    
  2. Do a production build.

    yarn build
    
  3. Add the dist directory.

    git add -f dist
    
  4. Create the release commit.

    git commit -m "Release v0.1.0"
    
  5. Create a release tag.

    git tag -a v0.1.0 -m "Create release tag v0.1.0"
    
  6. Push to GitHub. follow-tags tells Git to push the release tag along with our release branch.

    git push --set-upstream origin release-0.1.x --follow-tags
    

Submit the plugin

For a plugin to be published on Grafana Plugins, it needs to be added to the grafana-plugin-repository.

  1. Fork the grafana-plugin-repository

  2. Add your plugin to the repo.json file in the project root directory:

    {
      "id": "<plugin id>",
      "type": "<plugin type>",
      "url": "https://github.com/<username>/my-plugin",
      "versions": [
        {
          "version": "<version>",
          "commit": "<git sha>",
          "url": "https://github.com/<username>/my-plugin"
        }
      ]
    }
    
  3. Create a pull request.

Once your plugin has been accepted, it'll be published on Grafana Plugin, available for anyone to install!

We're auditing every plugin that's added to make sure it's ready to be published. This means that it might take some time before your plugin is accepted. We're working on adding more automated tests to improve this process.