Bitergia Analytics Plugin for OpenSearch.
This plugin allows to define a dashboards menu on the top bar of the app and configure the branding of the app (color, logos, text, etc).
You can find the different versions of the plugins on the releases page on Github.
Copy the link of the asset you want to install and run the following command inside
opensearch-dashboards/bin
folder of your opensearch-dashboard
instance.
opensearch-dashboards-plugin install <url>
For example:
opensearch-dashboards-plugin install https://github.com/Bitergia/bitergia-analytics-plugin/releases/download/0.0.3_1.2.0/bitergia-analytics-plugin-0.0.3_1.2.0.zip
In order to make changes to this plugin or contributing to it, please read the following sections.
You will need node.js
and yarn
to build the plugin. You can use
nvm to install the required node version
of this plugin.
- Download OpenSearch Dashboards source code for the version that matches the OpenSearch Dashboards version specified in opensearch_dashboards.json. You can download it from their release page or clone the repository. We recommend to follow the OpenSearch Dashboards' developers guide to configure the environment.
- Change your node version to the version specified in
.node-version
inside the OpenSearch Dashboards root directory. You can usenvm
to do it. - Create a
plugins
directory inside the OpenSearch Dashboards source code directory, ifplugins
directory doesn't exist.cd OpenSearchDashboards mkdir plugins
- Check out this repository into the
plugins
directory.git clone https://github.com/Bitergia/bitergia-analytics-plugin plugins
- Install the dependencies.
cd OpenSearchDashboards/plugins/bitergia-analytics-plugin yarn osd bootstrap
To build the plugin's distributable zip simply run yarn build
.
Example output: ./build/bitergia-analytics-plugin-0.2.0_2.6.0.zip
To run and test the built version of plugin run inside OpenSearch-Dashboards folder the following command:
yarn start
Use the API to import and export the plugin's menu. You must use the
osd-xsrf:true
header for all API calls and Content-Type: application/json
when you send a payload.
Returns the menu data in a JSON format.
GET /_plugins/_bap/menu
curl -X GET <OSD URL>/_plugins/_bap/menu --header 'osd-xsrf: true' --user '<USERNAME>:<PASSWORD>'
Updates the menu data or creates one if it does not exist.
PUT /_plugins/_bap/menu
curl -X PUT <OSD URL>/_plugins/_bap/menu \
--header 'osd-xsrf: true' \
--user '<USERNAME>:<PASSWORD>' \
--header 'Content-Type: application/json' \
-d '{
"menu": [
{
"name": "Overview",
"dashboard_id": "Overview",
"type": "entry"
},
{
"name": "About",
"type": "menu",
"dashboards": [
{
"name": "Contact",
"type": "entry",
"dashboard_id": "https://example.com"
}
]
}
]
}'
To hide or show the Switch tenants
button on the user menu, add the configuration
property bitergia_analytics.hideTenantSelector
to the opensearch_dashboards.yml
file and set the value to either true
or false
. The selector is hidden by
default.
This project is licensed under Apache 2.0. See the LICENSE file for more information about it.
Thanks to the great work of OpenDistro's Kibana Reports plugin. We took some of their files to create the skeleton of this plugin.