An example Kibana plugin generated using the Kibana Plugin Generator. This plugin shows rows from an Elasticsearch index, which is obtained using the corresponding Kibana data view:
This plugin has been built targeting Elasticsearch 8.14, and therefore may not work for other versions. Specifically, it uses the following plugins:
- The core navigation plugin.
- The public data plugin allows for Elasticsearch indices to be queried.
- The unified search plugin provides UI components for accessing Kibana data views.
Building and maintaining your own Kibana plugins is a challenge, but can allow you to expand the existing capabilities of Kibana itself. While we do accept feature contributions, which are covered in the contributing guide for the Kibana repo, not every feature developers wish to add to Kibana is generic enough for the entire Elastic community to use.
The plugin section of the Kibana documentation gives good examples of known plugins built over the years by developers in the community. Specifically, they tend to cover several key themes:
- Applications and utilities to view cluster and other monitoring information in a useful way.
- Custom visualizations for use in dashboards that are challenging or impossible to construct via capabilities such as Lens, TSVB and Vega.
- Tools for embedding different content types such as Markdown or Timelion.
Indeed, many Elasticians build plugins to develop some of the Elastic features you've come to love in recent years too.
While it's great to have this ability to extend Kibana with your own features, it also exposes you to maintenance challenges for both your code and the cluster you install the plugin on, including:
- As explicitly stated in the documentation backward compatibility for plugins is not guaranteed, and the responsibility lies with you as a developer to release a new version of your plugin for each Kibana release. Failing to do so can prevent you from upgrading your cluster if the plugin becomes a critical component in your ecosystem and the accrual of technical debt.
- Building slow or poorly performing plugins can slow down Kibana itself. For this reason, we have performance considerations listed in our documentation.
- It's easy to reinvent the wheel and rebuild features that may be there or can be adapted to your use case. Make sure you're not rebuilding an existing feature and, if you do build a plugin, use the existing services and utilities when developing your plugin.
- Writing your own code can lead to the introduction of security vulnerabilities that could be used by nefarious actors to gain access to your cluster or data. Make sure you protect against common attacks and adhere to the security best practices listed in our documentation.
- The scope of benefit for a plugin is often limited to your benefit rather than the whole community. For general features that are feature requests, it might be worth considering raising a pull request to the Kibana repo instead.
See the Kibana contributing guide for instructions on setting up your development environment. Furthermore, for building a UI plugin you need to run the plugin as per these steps to pick up the browser bundles. Failing to do this will mean you'll see 404 and MIME-type errors similar to the below in your console:
GET http://localhost:5601/XXXXXXXXXXXX/bundles/plugin/kibanaExamplePlugin/1.0.0/kibanaExamplePlugin.plugin.js 404 (Not Found)
kibanaExamplePlugin:1 Refused to execute script from 'http://localhost:5601/XXXXXXXXXXXX/bundles/plugin/kibanaExamplePlugin/1.0.0/kibanaExamplePlugin.plugin.js' because its MIME type ('application/json') is not executable, and strict MIME type checking is enabled.
yarn kbn bootstrap
- Execute this to install node_modules and set up the dependencies in your plugin and in Kibana
yarn plugin-helpers build
- Execute this to create a distributable version of this plugin that can be installed in Kibana
yarn plugin-helpers dev --watch
- Execute this to build your plugin ui browser side so Kibana could pick up when started in development
Check out the below resources to learn about plugin development: