This datasource was created to connect Grafana with DeviceHive to track commands and notifications by particular device.
Based on Grafana Simple JSON Datasource plugin.
Prerequisites: You should have Grafana and npm installed and have permissions to copy data to Plugins folder(you could set it in grafana.ini in Paths->plugins).
- Clone this repo to Plugins folder -
git clone https://github.com/devicehive/devicehive-grafana-datasource.git; - Go into folder -
cd devicehive-grafana-datasource; - Install all packages -
npm install; - Build plugin -
npm run build; - Restart Grafana -
sudo service grafana-server restart; - Open Grafana in any browser;
- Open the side menu by clicking the Grafana icon in the top header;
- In the side menu click
Data Sources; - Click the
+ Add data sourcein the top header; - Select
DeviceHivefrom theTypedropdown; - Configure datasource.
- Open Grafana in any browser;
- Open the side menu by clicking the Grafana icon in the top header;
- In the side menu find
Dashboardsand in context menu click+ New; - Select Panel type from top header. Currently this plugin wirks fine with
GraphandSinglestattypes. - Click on
Panel Titleand chooseEdit; - In
Metricstab choose your data source name fromPanel Data Source; - Choose metric type from dropdown (
commandornotification); - Type path to variable inside command in input. (Remember you could use object and arrays inside it, f.e.
parameters.testData[0].temperature); - Click time range burron in the top header on the right.
- Type
now-2minFromtext field, choose refreshing option from dropdown and clickApply. (Remember cache is available for last 2 minutes only)