This example represents an http backend server that streams json data to a locally hosted grafana server. Very crude example which is still heavily under development. Examples used: Build streaming datasource for grafana Simple streaming datasrouce
- The example consist of an http backend and a grafana docker container.
- When the example DataStream Dashboard is opened the datasource will request the streaming from the backend
- Once the response starts to arrive to the data source the data will be displayed in the charts
- Run
docker-compose up --build --force-recreate -d main-server
- Access grafana on
http://localhost:3000
- Set data-stream datasource with the host address
http://localhost:8080
- Import the demo dashboard from under the Dashboards tab
- Once the setup steps are done the line chart panel can be accessed from the backend through
http://localhost:8080/show
- The data name can be changed in the panel edit page under the dataText field. If multiple series need to be shown, names need to be separated by a comma (For example: testData1,testData2).
- navigate in
./grafana/json-data-stream
- run
yarn install
(may requires to install some linux node.js packages) - run
yarn dev
This example is meant to be a POC and it is in a very early stage yet.
Only handles panels in a single dashboard
Data display gets slow after a while
The panel visualization is cleared every time you update the dashboard. If you have access to historical data, you can add, or backfill, it to the data frame before the first call to subscriber.next().