Skip to main content

Ecosystem Integration

...About 3 min

Ecosystem Integration


Grafana is an open source volume metrics monitoring and visualization tool, which can be used to display time series data and application runtime analysis. Grafana supports Graphite, InfluxDB and other major time series databases as data sources. IoTDB-Grafana-Connector is a connector which we developed to show time series data in IoTDB by reading data from IoTDB and sends to Grafana( in new window). Before using this tool, make sure Grafana and IoTDB are correctly installed and started.

Installation and deployment

Install Grafana

Install data source plugin

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

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

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

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

Then you need to restart grafana server, then you can use browser to visit grafana.

If you see "SimpleJson" in "Type" of "Add data source" pages, then it is install successfully.

Or, if you meet following errors:

Unsigned plugins were found during plugin initialization. Grafana Labs cannot guarantee the integrity of these plugins. We recommend only using signed plugins.
The following plugins are disabled and not shown in the list below:

Please try to find config file of grafana(eg. customer.ini in windows, and /etc/grafana/grafana.ini in linux), then add following configuration:

allow_loading_unsigned_plugins = "grafana-simple-json-datasource"

Start Grafana

If Unix is used, Grafana will start automatically after installing, or you can run sudo service grafana-server start command. See more information hereopen in new window.

If Mac and homebrew are used 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 hereopen in new window.

If Windows is used, start Grafana by executing grafana-server.exe, located in the bin directory, preferably from the command line. See more information hereopen in new window.

IoTDB installation

See in new window

IoTDB-Grafana-Connector installation

git clone

Start IoTDB-Grafana-Connector

  • Option one

Import the entire project, after the maven dependency is installed, directly runiotdb/grafana-connector/rc/main/java/org/apache/iotdb/web/grafanadirectory, this grafana connector is developed by springboot

  • Option two

In /grafana/target/directory

cd iotdb
mvn clean package -pl grafana-connector -am -Dmaven.test.skip=true
cd grafana/target
java -jar iotdb-grafana-connector-{version}.war

If following output is displayed, then iotdb-grafana-connector connector is successfully activated.

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

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

To configure properties, move the grafana-connector/src/main/resources/ to the same directory as the war package (grafana/target)

Explore in Grafana

The default port of Grafana is 3000, see http://localhost:3000/open in new window

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:8888open in new window.
After that, make sure IoTDB has been started, click "Save & Test", and "Data Source is working" will be shown to indicate successful configuration.

Design in dashboard

Add diagrams in dashboard and customize your query. See in new window

config grafana

# ip and port of IoTDB 
# Use this value to set timestamp precision as "ms", "us" or "ns", which must to be same with the timestamp
# precision of Apache IoTDB engine.

# Use this value to set down sampling true/false
# defaut sampling intervals
# aggregation function to use to downsampling the data (int, long, float, double)
# aggregation function to use to downsampling the data (boolean, string)

The specific configuration information of interval is as follows

<1h: no sampling

1h~1d : intervals = 1m

1d~30d:intervals = 1h

>30d:intervals = 1d

After configuration, please re-run war package

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

Copyright © 2024 The Apache Software Foundation.
Apache IoTDB, IoTDB, Apache, the Apache feather logo, and the Apache IoTDB project logo are either registered trademarks or trademarks of The Apache Software Foundation in all countries

Have a question? Connect with us on QQ, WeChat, or Slack. Join the community now.