Plugin to use CAN as a data source in Grafana.
- Grafana: 3.x
- Contrail: 3.2+
Note: Due to CORS restrictions you may run into issues. Refer below for possible solutions.
Not recommended: If you want to simply test the plugin, you can run your browser with security disabled.
grafana-cli plugins install juniper-contrailanalytics-datasource
cd /var/lib/grafana/plugins
git clone https://github.com/Juniper/grafana-can-plugin.git
sudo service grafana-server restart
Explaination of various fields required during datasource addition in Grafana.
URL
: Enter the URL of contrail query server. Usually it is :http://<hostname>:8081/
Access
:Direct
or viaproxy
- Contrail API Auth
Username
: Username for accessing data in CANPassword
: Password for the usernameTenant/Domain
Keystone URL
: URL of keystone server. Usually it is :http://<hostname>:35357/v2.0/tokens/
In order to make communication secure you will need to configure your contrail instance for HTTPS access and set appropriate CORS endpoints.
For HTTPS access one needs to configure SSL in contrail. Follow this link to configure SSL.
- Set up CORS policy on your keystone server.
- Use grafana's
proxy
option to reach contrail-api.
These links would be helpful for CORS setup in keystone:
Please note that all the methods listed below are hacks and should not be used in production.
- Use
proxy
access while configuring data source in grafana. When this option is set, grafana server makes a request to contrail instead of your browser. But, there is a catch. If yourkeystone-url
andurl
differ in origin, grafana would not relay the requests tokeystone-url
via the backend. - Set up grafana to share the origin as your keystone. You can install grafana on the same host as keystone for this. Now use the
proxy
access feature of grafana to reach contrail-api server.
This plugin requires node 6.10.0
npm install -g yarn
yarn install
npm run build