Kibana Custom Plugin

Hi, I build a custom kibana plugin and am trying to install it on kibana version 6.5.4. Does anyone know how to add a custom plugin in kibana? I tried to directly copy the plugin holder under kibana/plugins/, but the server failed to load. Is there any setup I missed?


Hi, here's the quickstart way:

  • Clone the Kibana Git repo
  • Install all the project dependencies: yarn kbn bootstrap
  • Run the Plugin Generator: node scripts/generate_plugin.js ambersplugin

That starts a script that asks you some questions. Then it installs a sample project in a relative location to where you cloned Kibana: ../kibana-extra/ambersplugin

Go to that directory, and I think yarn start will start Kibana with your plugin in loaded. There is script output that tells you exactly where to cd to and how to start the application.

Up to now, this is using the master branch of Kibana. You'll need to run Elasticsearch in master too, but there is a yarn es command in Kibana that can handle that pretty easily. These features are provided so you can load some test data and develop your plugin. There usually is not a compelling reason for working off of a non-master branch for plugin development. Doing so will only cause you to run with older versions of the development tools. You will need to switch to the 6.5 branch, but only to build your plugin.

When your plugin code is looking good, it's almost time to build it. First, we need to make sure the code will work with 6.5.4.

Now it is time to stop your 7.0 ES, switch to the 6.5 branch of Kibana, and re-run yarn kbn bootstrap. Similar, in your plugin, make a new branch called 6.5. Any differences needed in your code for 6.5 compatibility will go in here. You can run Kibana 6.5 the same way you ran master. Hopefully, everything will just work without needing any compatibility changes.

Once the branch versioning is straight and the testing is done, it's time to build. I think the command for doing that is yarn package, but you probably want to reference the package.json to make sure. The package command runs another script that asks you some questions, one of them being which version of Elastic Stack you are building for. Here, type in 6.5.4. You'll get a plugin package that can be installed into Kibana 6.5.4 using ./bin/kibana-plugin install.

Don't direct copy: use the plugin installer.

As maintenance on the plugin goes on, keep adding all the features and fixes into the master branch and backport the changes to your 6.5 branch, or as far back as you want it to go. That way, your plugin will always be compatible with the next-latest version of the Elastic Stack and will never be a bottleneck when you want to upgrade.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.