IoTDB/grafana
Jialin Qiao 1cb650fac7
add text support for grafana (#906)
2020-03-14 09:54:42 +08:00
..
conf add timestamp precision properties (#620) 2019-12-03 21:12:02 +08:00
img Translate grafana/readmd.md to english version (#507) 2018-12-25 13:24:28 +08:00
src/main/java/org/apache/iotdb/web/grafana add text support for grafana (#906) 2020-03-14 09:54:42 +08:00
pom.xml update version (#618) 2019-12-03 19:36:55 +08:00
readme.md Update readme (#536) 2019-11-11 12:32:22 +08:00
readme_zh.md Update readme (#536) 2019-11-11 12:32:22 +08:00

readme.md

Grafana

Outline

  • IoTDB-Grafana
    • Grafana installation
      • Install Grafana
      • Install data source plugin
      • Start Grafana
    • IoTDB installation
    • IoTDB-Grafana installation
      • Start IoTDB-Grafana
    • Explore in Grafana
      • Add data source
      • Design in dashboard

IoTDB-Grafana

This project provides a connector which reads data from IoTDB and sends to Grafana(https://grafana.com/). Before you use this tool, make sure Grafana and IoTDB are correctly installed and started.

Grafana installation

Install Grafana

Install data source plugin

After downloading this plugin, you can use the grafana-cli tool to install SimpleJson from the commandline:

grafana-cli plugins install grafana-simple-json-datasource

Alternatively, you can manually download the .zip file and unpack it into your grafana plugins directory.

  • {grafana-install-directory}\data\plugin\ (Windows)
  • /var/lib/grafana/plugins (Linux)
  • /usr/local/var/lib/grafana/plugins(Mac)

Start Grafana

If you use Unix, Grafana will auto start after installing, or you can run sudo service grafana-server start command. See more information here.

If you use Mac and homebrew to install Grafana, you can use homebrew to start Grafana. First make sure homebrew/services is installed by running brew tap homebrew/services, then start Grafana using: brew services start grafana. See more information here.

If you use Windows, start Grafana by executing grafana-server.exe, located in the bin directory, preferably from the command line. See more information here.

IoTDB installation

See https://github.com/apache/incubator-iotdb

IoTDB-Grafana installation

git clone https://github.com/apache/incubator-iotdb.git
mvn clean package -pl grafana -am -Dmaven.test.skip=true
cd grafana

Copy application.properties from conf/ directory to target directory. (Or just make sure that application.properties and iotdb-grafana-{version}.war are in the same directory.)

Edit application.properties

# ip and port of IoTDB 
spring.datasource.url = jdbc:iotdb://127.0.0.1:6667/
spring.datasource.username = root
spring.datasource.password = root
spring.datasource.driver-class-name=org.apache.iotdb.jdbc.IoTDBDriver
server.port = 8888

Start IoTDB-Grafana

cd grafana/target/
java -jar iotdb-grafana-{version}.war

If you see the following output, iotdb-grafana connector is successfully activated.

$ java -jar iotdb-grafana-{version}.war

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v1.5.4.RELEASE)
...

Explore in Grafana

The default port of Grafana is 3000, see http://localhost:3000

Username and password are both "admin" by default.

Add data source

Select Data Sources and then Add data source, select SimpleJson in Type and URL is http://localhost:8888

Design in dashboard

Add diagrams in dashboard and customize your query. See http://docs.grafana.org/guides/getting_started/